[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple compile errors on MacOS X (Lion)



On Nov 21, 2012, at 1:04 PM, ZXID.User@xxxxxxxxxxxxx wrote:

> Thanks for this analysis. So in fact it is not the assignment but one
> of the printf expansions. Casting to long and using %lx seems like
> the right fix.
Might be, but maybe not on every platform? Found this:
http://stackoverflow.com/q/5701450/326156
Maybe something like intptr_t might be more portable?

> 
> I just put out 1.12 release at http://zxid.org/zxid-1.12.tgz so you can test.
> In order to test the zxbusd compile you should say
> 

Just tried the new code, but there still seems to be a problem.


Confucius:zxid-1.12 mdondrup$  make  TARGET=macosx 
If you get compilation errors, try: make help
Now trying to compile series of test programs to check dependencies...

gcc -g -fPIC -fmessage-length=0 -Wno-unused-label -Wno-unknown-pragmas -fno-strict-aliasing -DMAYBE_UNUSED='' -DUSE_CURL -DUSE_OPENSSL -DUSE_PTHREAD -pthread -DMACOSX -D_REENTRANT -DDEBUG -DMUTEX_DEBUG=1 -I. -I/Users/mdondrup/Downloads/zxid-1.12 -I/opt/include -I/usr/local/include -I/include -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apache2 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apr-1   -c -o zxid.o zxid.c
In file included from zxid.c:22:
platform.h:121: error: expected declaration specifiers or ... before size_t
In file included from zxid.c:22:
platform.h:147:60: error: event.h: No such file or directory
make: *** [zxid.o] Error 1

I think the 1. error in platform.h could be fixed by including stdlib.h.

Also, after adding 
#include <stdlib.h>

replacing #include <event.h>          /* for kqueue used by zxbusd */
#include <sys/event.h>          /* for kqueue used by zxbusd */

make runs through.

make zxbus yields:

Confucius:zxid-1.12 mdondrup$  make zxbus  TARGET=macosx 
gcc -g -fPIC -fmessage-length=0 -Wno-unused-label -Wno-unknown-pragmas -fno-strict-aliasing -DMAYBE_UNUSED='' -DUSE_CURL -DUSE_OPENSSL -DUSE_PTHREAD -pthread -DMACOSX -D_REENTRANT -DDEBUG -DMUTEX_DEBUG=1 -I. -I/Users/mdondrup/Downloads/zxid-1.12 -I/opt/include -I/usr/local/include -I/include -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apache2 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apr-1   -c -o zxbusd.o zxbusd.c
zxbusd.c: In function parse_port_spec:
zxbusd.c:195: warning: large integer implicitly truncated to unsigned type
zxbusd.c: In function main:
zxbusd.c:601: error: PTHREAD_MUTEX_ERRORCHECK_NP undeclared (first use in this function)
zxbusd.c:601: error: (Each undeclared identifier is reported only once
zxbusd.c:601: error: for each function it appears in.)
zxbusd.c:720: warning: comparison is always false due to limited range of data type
make: *** [zxbusd.o] Error 1

Before, I had just added
#define PTHREAD_MUTEX_ERRORCHECK_NP 1
directly before. Inserting this, solves this error, then leads to more errors:

Confucius:zxid-1.12 mdondrup$  make zxbus  TARGET=macosx 
gcc -g -fPIC -fmessage-length=0 -Wno-unused-label -Wno-unknown-pragmas -fno-strict-aliasing -DMAYBE_UNUSED='' -DUSE_CURL -DUSE_OPENSSL -DUSE_PTHREAD -pthread -DMACOSX -D_REENTRANT -DDEBUG -DMUTEX_DEBUG=1 -I. -I/Users/mdondrup/Downloads/zxid-1.12 -I/opt/local/include -I/usr/local/include -I/include -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apache2 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/apr-1   -c -o hiios.o hiios.c
hiios.c: In function hi_in_out:
hiios.c:204: error: EPOLLHUP undeclared (first use in this function)
hiios.c:204: error: (Each undeclared identifier is reported only once
hiios.c:204: error: for each function it appears in.)
hiios.c:204: error: EPOLLERR undeclared (first use in this function)
hiios.c:218: error: EPOLLOUT undeclared (first use in this function)
hiios.c:260: error: EPOLLIN undeclared (first use in this function)
make: *** [hiios.o] Error 1