You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Staffan Vilcans <st...@jadestone.se> on 2005/04/05 10:34:00 UTC

Using log4cxx, building with ant

I have managed to build log4cxx and have received a file called 
liblog4cxx.la that I suspect I should link to my project (the 
documentation doesn't say much about how to actually use log4cxx in a 
project). The problem is that my project uses ant (with <cc> ) to build 
and not plain vanilla make. I have tried to add it using
<fileset dir="/home/staffanv/log4cxx-0.9.7/src" includes="liblog4cxx.la"/>
but all I get for my effort is "file not recognized: Unknown file format".

Any ideas?

-- 
Cell: +46 737 282 486
Phone: +46 8 442 75 94 (ext 242)
Fax: +46 8 24 05 08
www.jadestone.se
Björns Trädgårdsgränd 1, 116 21 Stockholm, Sweden


Re: Using log4cxx, building with ant

Posted by Staffan Vilcans <st...@jadestone.se>.
Staffan Vilcans wrote:

> I have managed to build log4cxx and have received a file called 
> liblog4cxx.la that I suspect I should link to my project (the 
> documentation doesn't say much about how to actually use log4cxx in a 
> project). The problem is that my project uses ant (with <cc> ) to 
> build and not plain vanilla make. I have tried to add it using
> <fileset dir="/home/staffanv/log4cxx-0.9.7/src" 
> includes="liblog4cxx.la"/>
> but all I get for my effort is "file not recognized: Unknown file 
> format".

You shouldn't try to link it as a fileset. Instead use <linkerarg> such as
<linkerarg value="-llog4cxx"/>

That should do the trick.

-- 
Cell: +46 737 282 486
Phone: +46 8 442 75 94 (ext 242)
Fax: +46 8 24 05 08
www.jadestone.se
Björns Trädgårdsgränd 1, 116 21 Stockholm, Sweden


Re: Using log4cxx, building with ant

Posted by Curt Arnold <ca...@apache.org>.
Use

<libset dir="/home/staffanv/log4cxx-0.9.7/src" libs="log4cxx"/>

The CVS HEAD of log4cxx also uses ant + cc to build and fixes a large 
number of issues (but has several issues outstanding).  If you are just 
getting started, I would recommend starting with the CVS HEAD.



On Apr 5, 2005, at 3:34 AM, Staffan Vilcans wrote:

> I have managed to build log4cxx and have received a file called 
> liblog4cxx.la that I suspect I should link to my project (the 
> documentation doesn't say much about how to actually use log4cxx in a 
> project). The problem is that my project uses ant (with <cc> ) to 
> build and not plain vanilla make. I have tried to add it using
> <fileset dir="/home/staffanv/log4cxx-0.9.7/src" 
> includes="liblog4cxx.la"/>
> but all I get for my effort is "file not recognized: Unknown file 
> format".
>
> Any ideas?
>
> -- 
> Cell: +46 737 282 486
> Phone: +46 8 442 75 94 (ext 242)
> Fax: +46 8 24 05 08
> www.jadestone.se
> Björns Trädgårdsgränd 1, 116 21 Stockholm, Sweden
>