Compiling on OSX
Trying to get lanmap2 up and running on OSX 10.9, anyone have any success?
Here is the error trail:
cc -W -Wall -std=gnu99 -Wno-unused -Wno-unused-parameter -ggdb -O0 -DDEBUG -c -o cap.o cap.c In file included from cap.c:19: ./util.h:53:8: error: expected parameter declarator size_t strlcpy(char *dst, const char *src, size_t size); ^ /usr/include/secure/_string.h:105:44: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
define _USE_FORTIFY_LEVEL 2
^
In file included from cap.c:19: ./util.h:53:8: error: expected ')' /usr/include/secure/_string.h:105:44: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
define _USE_FORTIFY_LEVEL 2
^
./util.h:53:8: note: to match this '(' /usr/include/secure/_string.h:105:44: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ In file included from cap.c:19: ./util.h:53:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] size_t strlcpy(char *dst, const char *src, size_t size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/secure/_string.h:105:44: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^~~~~~~~~~~~~~~~~~~~ /usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^~~~~~~~~~~~~~~~~~~~~ In file included from cap.c:19: ./util.h:53:8: error: conflicting types for '__builtin___strlcpy_chk' /usr/include/secure/_string.h:105:3: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^ ./util.h:53:8: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)' /usr/include/secure/_string.h:105:3: note: expanded from macro 'strlcpy' __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest)) ^ In file included from cap.c:19: ./util.h:54:8: error: expected parameter declarator size_t strlcat(char *dst, const char *src, size_t size); ^ /usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
define _USE_FORTIFY_LEVEL 2
^
In file included from cap.c:19: ./util.h:54:8: error: expected ')' /usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
define _USE_FORTIFY_LEVEL 2
^
./util.h:54:8: note: to match this '(' /usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ In file included from cap.c:19: ./util.h:54:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] size_t strlcat(char _dst, const char *src, size_t size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^~~~~~~~~~~~~~~~~~~~ /usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^~~~~~~~~~~~~~~~~~~~~ In file included from cap.c:19: ./util.h:54:8: error: conflicting types for '__builtin___strlcat_chk' /usr/include/secure/_string.h:111:3: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^ ./util.h:54:8: note: '__builtin___strlcat_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)' /usr/include/secure/string.h:111:3: note: expanded from macro 'strlcat' __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest)) ^ 2 warnings and 6 errors generated. make: ** [cap.o] Error 1
OK, the problem is easy enough to understand -- it appears that OS X 10.9 is defining 'strlcpy' whereas earlier versions did not. This causes a conflict with my util function of the same name. Need to figure out the idiomatic way of detecting this.
Ok, I'm not much of a C person, but if there is something I can do to assist let me know.