[CMake] howto check for res_init() ?

Alexander Neundorf a.neundorf-work at gmx.net
Sat Jan 14 11:46:09 EST 2006


Hi, 
 
I tried to check for the function res_init() 
 
with  
CHECK_FUNCTION_EXISTS(res_init HAVE_RES_INIT) 
 
This always fails, although it shouldn't. 
The problem is this line in resolv.h: 
 
/usr/include$ grep res_init * 
resolv.h:#define res_init               __res_init 
resolv.h:int            res_init __P((void)); 
 
I.e. resolv() is only a macro, the actual function name is __res_init(), 
but the compiler/linker doesn't know this since resolv.h is not included 
when compiling the test program for CHECK_FUNCTION_EXISTS(). 
So what can I do ? 
 
Bye 
Alex 
 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl


More information about the CMake mailing list