Hi Ambarish,

Ambarish Mitra wrote:
[...]
> Therefore, the only difference is while in first case, I used Solaris ld,
> here I have GNU ld. Does it matter?
It should not. I am building the SVN Head each night (see
http://www.littletux.net/log4cxx) on Debian GNU/Linux using gcc 3.3.5.

[...]
> This did not work still, when I tried to link [-L and -l switches are
> correct]
Are you sure? Shouldnt the "-llog4cpp" be "-llog4cxx" ?

Ah, I just recognized one other thing: which version are you actually
using? Your path looks like you are using 0.9.7 which has some
severe bugs and is quite out of date. You should probably try
using 0.9.8 (which is, on the other hand, still under development).
A daily dist tarball is available at the above URL.

Regards,

        Andreas

> g++ -c -I/home/ambarish/softwares/log4cxx_097/include -o main.o main.cpp
> g++ -o log -lpthread -L/home/ambarish/softwares/log4cxx/lib -llog4cpp main.o
> 
> 
> main.o(.text+0x195): In function `main':
> : undefined reference to
> `log4cxx::PropertyConfigurator::configure(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> main.o(.text+0x26d): In function
> `__static_initialization_and_destruction_0(int, int)':
> : undefined reference to `log4cxx::Logger::getLogger(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> 
> Any pointers will be extremely helpful. The exact same code works in Solaris
> - can the differnt ld be a cause? If anyone has faced such a situation
> before, please guide. 
> 
> Regards,
> Ambarish.


Reply via email to