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

Steven Van Ingelgem steven at vaningelgem.be
Wed Jul 8 09:03:30 EDT 2009


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 compiler ABI info - done
-- Looking for snprintf
-- Looking for snprintf - found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/tmp/CMCheckWhatEver


Determining if the function snprintf exists passed with the following
output:
Change Dir: C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp

Run Build Command:C:/MinGW/bin/mingw32-make.exe "cmTryCompileExec/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec.dir\build.make
CMakeFiles/cmTryCompileExec.dir/build

mingw32-make.exe[1]: Entering directory
`C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp'

"C:\Program Files\CMake 2.7\bin\cmake.exe" -E cmake_progress_report
C:\tmp\CMCheckWhatEver\CMakeFiles\CMakeTmp\CMakeFiles 1

Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.obj

C:\MinGW\bin\gcc.exe  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf
-fno-builtin   -o
CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj   -c "C:\Program
Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c"

Linking C executable cmTryCompileExec.exe

"C:\Program Files\CMake 2.7\bin\cmake.exe" -E cmake_link_script
CMakeFiles\cmTryCompileExec.dir\link.txt --verbose=1

C:\MinGW\bin\gcc.exe     -DCHECK_FUNCTION_EXISTS=snprintf -fno-builtin
CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj  -o
cmTryCompileExec.exe -Wl,--out-implib,libcmTryCompileExec.dll.a
-Wl,--major-image-version,0,--minor-image-version,0  -lkernel32 -luser32
-lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32


mingw32-make.exe[1]: Leaving directory
`C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp'



2009/7/8 Eric Noulard <eric.noulard at gmail.com>

> 2009/7/8 Steven Van Ingelgem <steven at vaningelgem.be>:
> >
> >
> > 2009/7/8 Eric Noulard <eric.noulard at gmail.com>
> >
> > -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 think CMake only takes parameters starting with -D and /D?
>
> That would definitely be a CMake bug,
>
> CMAKE_REQUIRED_FLAGS = string of compile command line flags
> CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
>
> CMAKE_REQUIRED_DEFINITIONS should  only work with -DBLAH=<blahval>
>
> but
> CMAKE_REQUIRED_FLAGS should accept any compile flags.
>
> Would you try the attached project.
> 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
> /home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c
>
> which is the expect command line.
>
> However my test env is Linux + gcc 4.3.2.
> May be you can try that on your side?
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090708/288fd4e3/attachment.htm>


More information about the CMake mailing list