[CMake] kernel32 functions

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Jul 18 19:34:29 EDT 2008


checkfunctionexist only check for cdecl's functions. So if -like me-
you are trying to check for a stdcall one... you are stuck:

http://www.cmake.org/pipermail/cmake/2008-May/021470.html

Check the header file for the exact declaration.

HTH
-Mathieu

On Fri, Jul 18, 2008 at 6:25 PM, Ben van Klinken <bvanklinken at gmail.com> wrote:
> First time poster, long time user. Great work cmake team!
>
> I'm trying to get cmake to detect several kernel32 functions but I can't get
> cmake to find the actual functions. I've tried taking CheckFunctionExists.c
> and compiling it in a seperate projects and everything works as expected.
> The linker lists kernel32.lib in the error output.
>
> Below is visual studio 6 output, but visual studio 8 has the same issue.
> Going back to CMake 2.4 doesn't help either. Trying with other kernel
> functions such as CreateFileMappingA doesn't work either.
>
> I'm stuck; I couldn't find anything i think is releveant in the cmake
> mailing list archives or on google. Any idea where things are going wrong?
>
>
> Thanks,
> Ben
> ---
>
> Determining if the function <ol><li>MapView</li></ol>OfFile exists failed
> with the following output:
> Change Dir: D:/projects/svn_clucene2_4_3-reloaded/msvc6/CMakeFiles/CMakeTmp
>
> Run Build Command:C:\PROGRA~1\MICROS~3\Common\MSDev98\Bin\MSDEV.COM
> CMAKE_TRY_COMPILE.dsw /MAKE "cmTryCompileExec - Debug" /BUILD
> --------------------Configuration: cmTryCompileExec - Win32
> Debug--------------------
>
> Compiling...
>
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
>
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>
> cl /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WINDOWS" /D
> CHECK_FUNCTION_EXISTS=MapViewOfFile /D "_MBCS" /D CMAKE_INTDIR=\"Debug\"
> /Fo"Debug/" /Fd"Debug/" /FD /GZ   /Zm1000  /GZ  /TC /c
>
>    "C:\Program Files\CMake
> 2.6\share\cmake-2.6\Modules\CheckFunctionExists.c"
>
> CheckFunctionExists.c
>
> Linking...
>
> Microsoft (R) Incremental Linker Version 6.00.8168
>
> Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
>
> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
> shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
> /version:0.0 /stack:0x989680 /subsystem:console /incremental:yes
> "/pdb:D:\projects\svn_clucene2_4_3-reloaded\msvc6\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.pdb"
> /debug /machine:I386
> "/out:D:\projects\svn_clucene2_4_3-reloaded\msvc6\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.exe"
> /pdbtype:sept /IGNORE:4089
> /implib:D:\projects\svn_clucene2_4_3-reloaded\msvc6\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.lib
>
> ".\Debug\CheckFunctionExists.obj"
>
> CheckFunctionExists.obj : error LNK2001: unresolved external symbol
> _MapViewOfFile
>
> D:\projects\svn_clucene2_4_3-reloaded\msvc6\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.exe
> : fatal error LNK1120: 1 unresolved externals
>
> Error executing link.exe.
>
>
>
> cmTryCompileExec.exe - 2 error(s), 0 warning(s)
>
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Mathieu


More information about the CMake mailing list