Hi, 
thanks a lot. I managed to compile the the test programm with an ant build 
script.
Your libtool hint still produces some error when he tries to link.
I downloaded your binary version from littletux and libtool said that it 
misses "libaprutil-1.la", so I took a look into iblog4cxx.la and created 
the .la files for apr on my own.
But than I get this nasty linking errors again. :/
Btw. is there a better solution than hardcoding file path to libaprutil-1.la 
in the iblog4cxx.la file?

I also still didn't find out how to cross-compile with the ant build.xml, is 
it possible anyway? Hmm, perhaps this should be handeled in a different 
thread. 

Best regards,
Daniel


Am Montag, 31. Oktober 2005 12:37 schrieb Andreas Fester:
> Hi,
>
> I did not find the reason why it does not work the way
> you do it, but it works when you are using libtool:
>
> $ libtool --mode=compile g++ -static -c -I../log4cxx-0.9.8/include -o
> test.o  test.cpp
>
> $ libtool --mode=link g++ ../log4cxx-0.9.8-build/src/.libs/liblog4cxx.la
> -static -o test test.o
>
> > I just build a static version from the svn head and tried to compile a
> > little
>
> You should probably consider using the version from
> http://www.littletux.net/log4cxx since it contains some additional
> patches which have not yet been committed to SVN.
>
> Best Regards,
>
>       Andreas
>
> [...]
>
> > #include <log4cxx/logger.h>
> > #include <log4cxx/basicconfigurator.h>
> > #include <log4cxx/propertyconfigurator.h>
> > #include <log4cxx/helpers/exception.h>
> >
> > #include <iostream>
> >
> > using namespace std;
> > using namespace log4cxx;
> > using namespace log4cxx::helpers;
> >
> > LoggerPtr logger(Logger::getLogger("MyLogging.Test"));
> >
> > int main(int argc, char *argv[])
> > {
> > //  LOG4CXX_ERROR(logger, "My first error Log");
> >   cout << "jojo" << endl;
> >
> >
> > return 0;
> > }
> >
> >
> > And tried to compile it with:
> > g++ -I./include -L./lib -llog4cxx  -static -o test  test.cpp
> >
> > And the result is:
> > /tmp/ccUOHsmb.o: In function
> > `__static_initialization_and_destruction_0(int, int)':
> > test.cpp:(.text+0xda): undefined reference to
> > `log4cxx::Logger::getLogger(char const*)'
> > collect2: ld returned 1 exit status

Reply via email to