Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-09 Thread Eric Noulard
2009/7/9 Mathieu Malaterre : > On Wed, Jul 8, 2009 at 11:22 PM, Alexander > Neundorf wrote: >> >> Did you try using check_symbol_exists() ? > > Indeed. > > Ref: > http://public.kitware.com/Bug/view.php?id=8246 > > Solution: > INCLUDE(CheckSymbolExists) > CHECK_SYMBOL_EXISTS(strcasecmp "strings.h"

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-09 Thread Mathieu Malaterre
On Wed, Jul 8, 2009 at 11:22 PM, Alexander Neundorf wrote: > On Wednesday 08 July 2009, Steven Van Ingelgem wrote: >> Hi, >> >> >> I tried this call: >> CHECK_FUNCTION_EXISTS(snprintf  HAS_snprintf) >> >> >> Which results in this error being generated: >> C:\MinGW\bin\gcc.exe   -g -ggdb -O0 -Wall -

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Alexander Neundorf
On Wednesday 08 July 2009, Steven Van Ingelgem wrote: > Hi, > > > I tried this call: > CHECK_FUNCTION_EXISTS(snprintf HAS_snprintf) > > > Which results in this error being generated: > C:\MinGW\bin\gcc.exe -g -ggdb -O0 -Wall -Werror > -DCHECK_FUNCTION_EXISTS=snprintf -o > CMakeFiles\cmTryCompi

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Hendrik Sattler : > Zitat von Eric Noulard : >> >> It works for me and the CMakeFiles/CMakeOutput.log reads: >> >> Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o >> /usr/bin/gcc  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf >> -fno-builtin   -o >> CMakeFiles/cmTr

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Steven Van Ingelgem
Probably I did something wrong than: C:\tmp\CMCheckWhatEver>cmake . -G"MinGW Makefiles" -- The C compiler identification is GNU -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works -- Detecting C compiler ABI info -- Detecting C comp

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Hendrik Sattler
Zitat von Eric Noulard : It works for me and the CMakeFiles/CMakeOutput.log reads: Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o /usr/bin/gcc -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf -fno-builtin -o CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o -c /

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Steven Van Ingelgem
2009/7/8 Eric Noulard -fno-builtin is not a definition, and try_compile (following the cmake docs) will add it to "add_definitions()", maybe it will work, but I think that's also not a very clean solution ;). I tried your solution, but I didn't see the parameter added into the error log... So I t

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Steven Van Ingelgem : > Hi Eric, > > > 1) Your first option wouldn't work because "CMAKE_REQUIRED_FLAGS" isn't > known by neither try_compile, neither the macro. Did you try it? The documentation says: CheckFunctionExists macro which checks if the function exists CHECK_FU

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Steven Van Ingelgem
Hi Eric, 1) Your first option wouldn't work because "CMAKE_REQUIRED_FLAGS" isn't known by neither try_compile, neither the macro. 2) Wouldn't work either because try_compile doesn't take command line parameters (at least not in this form & unless you will construct the makefile from hand inside

Re: [CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Steven Van Ingelgem : > Hi, > > > I tried this call: > CHECK_FUNCTION_EXISTS(snprintf  HAS_snprintf) > > > Which results in this error being generated: > C:\MinGW\bin\gcc.exe   -g -ggdb -O0 -Wall -Werror > -DCHECK_FUNCTION_EXISTS=snprintf   -o > CMakeFiles\cmTryCompileExec.dir\CheckFunctio

[CMake] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Steven Van Ingelgem
Hi, I tried this call: CHECK_FUNCTION_EXISTS(snprintf HAS_snprintf) Which results in this error being generated: C:\MinGW\bin\gcc.exe -g -ggdb -O0 -Wall -Werror -DCHECK_FUNCTION_EXISTS=snprintf -o CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj -c "C:\Program Files\CMake 2.7\sh