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

Re: [xmlblaster] Compiling cpp client in mac osx


please check xmlBlaster/src/c/util/msgUtil.c
where other gethostbyname_r() implementations are.
Probably there is one which works with MAC.
(sorry, i forgot this in the last response).


Marcel Ruff wrote:
Ricardo Jorge Jota wrote:

I'm having some troubles compiling xmlBlaster c++ client in Mac OS X 10.4 and was wondering if anyone
had successfully compiled the c++ client in Mac OS X. I ran into several troubles, some of then I managed to solve.

Prior to the compilation I installed the required libraries and edited the build.properties:

- Zlib was already installed in osx (/usr )
- Using fink I installed both xerces-c_2.6.0 and sqlite 2.8.16 (/sw)

- Build.properties:
# On Windows you have to choose the name, usually 'zlib' or 'zlib1' (defaults to 'z' for UNIX):



XMLCPP_HOME = /sw/lib

--------- During the compilation i got the following errors:

- First malloc.h wasn't being found. This was easily solved editing the #include in source code.
What was the change you made?
Did the C client compile well without changes (build c), where the problems in C++ only?

After this problem was solved the following command (the ./build -verbose cpp showed me the command)
gcc -g -prebind -dynamiclib -o libxmlBlasterClientCD.dylib ../build.tmp/objCD/helper.o ../build.tmp/objCD/XmlBlasterAccessUnparsed.o ../build.tmp/objCD/CallbackServerUnparsed.o ../build.tmp/objCD/XmlBlasterConnectionUnparsed.o ../build.tmp/objCD/msgUtil.o ../build.tmp/objCD/xmlBlasterSocket.o ../build.tmp/objCD/SQLiteQueue.o ../build.tmp/objCD/Properties.o ../build.tmp/objCD/xmlBlasterZlib.old: warning prebinding disabled because of undefined symbols

ld: Undefined symbols:
/usr/bin/libtool: internal link edit command failed

Most of these undefined symbols were solved by removing the -prebind and including the right libraries, thus the new command looked like :
gcc -g -dynamiclib -L/usr/lib -L/sw/lib -lsqlite -lz -lpthread /* The rest of the command was removed */
Looks like the cpptasks (http://sourceforge.net/projects/ant-contrib/)
has problems with Mac OS X. Probably you should ask for this issue
on the ant-contrib mailing list.

This is the C shared lib linking output on my Linux box:

gcc -g -shared -o libxmlBlasterClientCD.so ../build.tmp/objCD/helper.o ../build.tmp/objCD/XmlBlasterAccessUnparsed.o ../build.tmp/objCD/CallbackServerUnparsed.o ../build.tmp/objCD/XmlBlasterConnectionUnparsed.o ../build.tmp/objCD/msgUtil.o ../build.tmp/objCD/xmlBlasterSocket.o ../build.tmp/objCD/SQLiteQueue.o ../build.tmp/objCD/Properties.o ../build.tmp/objCD/xmlBlasterZlib.o -L/opt/sqlite-bin/lib -lsqlite -L/opt/zlib-bin/lib -lz

I wonder why cpptasks leaves away the sqlite and zlib in your case (pthread is not needed explicitly on Linux).

Unfortunately _gethostbyname_r doesn't get solved and after "googling" it seems that this symbols doesn't exist in OS X.
This is just the thread safe variant of gethostbyname().
Please add your own gethostbyname_r() variant in your code and implement it using

Please give us feedback/pathes of all changes you have added so we
can add support for MAC,


Any help would be really appreciated, Ricardo Jota