CMake build of master branch is broken

26 views
Skip to first unread message

mat...@gmail.com

unread,
Dec 11, 2014, 7:11:55 AM12/11/14
to ach-...@googlegroups.com
It seems like the dns.c file is missing in the CMakeLists.txt file.


Ana Huamán

unread,
Dec 12, 2014, 8:04:38 AM12/12/14
to ach-...@googlegroups.com


I commited a fix adding src/dns.c as source for libach (same way it is in Makefile.am). However, there is still a couple of errors related to src/dns.c, which I fixed doing the following to my CMakeLists.txt:

#BSD fix
add_definitions( -D_BSD_SOURCE )
#FLAG fix
set( CMAKE_C_FLAGS "-std=c99" )
# RESOLV fix:
target_link_libraries(ach pthread ${LIBRT} resolv)

The errors only occur when using CMakeLists (autoconf proves smarter detecting the system / setting flags). By adding the lines above ach compiled fine on my laptop (Ubuntu 12.04, 32 bits)

PS.- The fixes above are in response to the following errors:

BSD AND FLAG fixes in response to:
/usr/include/resolv.h:383:1: error: unknown type name ‘u_char’
/usr/include/resolv.h:383:49: error: unknown type name ‘u_char’
// A long list of similar errors to the ones above
/home/ana/Software/testing/ach3/src/dns.c: In function ‘parse_dns_srv’:
/home/ana/Software/testing/ach3/src/dns.c:126:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
/home/ana/Software/testing/ach3/src/dns.c:126:5: note: use option -std=c99 or -std=gnu99 to compile your code

RESOLV fix in response to:
Linking C executable ach-example
libach.so.1.2.1: error: undefined reference to '__dn_skipname'
libach.so.1.2.1: error: undefined reference to '__dn_expand'
libach.so.1.2.1: error: undefined reference to '__res_search'
libach.so.1.2.1: error: undefined reference to '__res_mkquery'
Reply all
Reply to author
Forward
0 new messages