[CMake] CHECK_FUNCTION_EXISTS(UuidCreate HAVE_UUIDCREATE)
Mathieu Malaterre
mathieu.malaterre at gmail.com
Sun May 4 12:18:14 EDT 2008
Hi,
According to:
http://msdn.microsoft.com/en-us/library/aa379205(VS.85).aspx
The symbol UuidCreate can be found in rpcrt4, so I used the
following cmake commands:
SET(CMAKE_REQUIRED_LIBRARIES "rpcrt4")
CHECK_FUNCTION_EXISTS(UuidCreate HAVE_UUIDCREATE)
But running it, gives me:
-- Looking for UuidCreate
-- Looking for UuidCreate - not found
And in the log:
Determining if the function UuidCreate exists failed with the following output:
nmake -f CMakeFiles\cmTryCompileExec.dir/build.make /nologo -L
CMakeFiles\cmTryCompileExec.dir\build^M
"C:\Program Files\CMake 2.4\bin\cmake.exe" -E
cmake_progress_report
C:\cygwin\home\mmalaterre\Projects\gdcm\release-cl\CMakeFiles\CMakeTmp\CMakeFiles
1^M
^[[32mBuilding C object
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.obj^M
^[[0m C:\PROGRA~1\MIA4C6~1\bin\cl.exe
@c:\DOCUME~1\MMALAT~1.BIO\LOCALS~1\Temp\nmF9A.tmp^M
CheckFunctionExists.c^M
^[[31m^[[1mLinking C executable cmTryCompileExec.exe^M
^[[0m "C:\Program Files\CMake 2.4\bin\cmake.exe" -P
CMakeFiles\cmTryCompileExec.dir\cmake_clean_target.cmake^M
C:\PROGRA~1\MIA4C6~1\bin\cl.exe /nologo
@c:\DOCUME~1\MMALAT~1.BIO\LOCALS~1\Temp\nmF9B.tmp^M
CheckFunctionExists.obj : error LNK2019: unresolved external symbol
_UuidCreate referenced in function _main^M
cmTryCompileExec.exe : fatal error LNK1120: 1 unresolved externals^M
NMAKE : fatal error U1077: 'C:\PROGRA~1\MIA4C6~1\bin\cl.exe' : return
code '0x2'^M
Stop.^M
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Platform SDK
for Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'^M
Stop.^M
Of course, if I manually force the linking to rpcrt4 everything works
as expected...
Anyone sees my mistake ?
Thanks,
--
Mathieu
More information about the CMake
mailing list