From: Curt A. <ca...@ho...> - 2002-04-07 18:49:19
|
There are at least four distinct ways to add a library to the link command currently, and probably time to clean that up. The way that I was using in the Xerces was: <libset> <!-- omitting dir attribute searches library paths --> <fileset> <include name="whatever.lib" if="whenever"/> </fileset> </libset> This form allows you to put conditions on the libraries included and was working for me. I guess you are probably using: <libset libs="whatever1 whatever2"/> This form was supposed to imply both the installed location and the extension of the library from the parser. I haven't used it and and not sure the value of implying the extension. The current structure also allows you to <libset> <fileset dir="${build.dir}" includes="mylib.lib"/> <libset> Which would be equivalent to just adding the fileset to the containing <cc> or <linker> element (the fourth way). If you are trying to link with a library found in the library path, try using the first form. If you are linking with a library that you know the location of, add a corresponding entry in the overall fileset. If that doesn't work, it may be because the extension of the library is not recognized as a type that the linker can consume (currently ".o", ".a" and ".lib" for GccLinker if I remember correctly). For my part, it would probably be good to collapse LibSet and FileSet, so that <libset> and <fileset> would take the same attributes but <libset> would not allow a dir attribute. That would result in the first form looking like: <libset> <include name="whatever.lib" if="whenever"/> </libset> And would allow you to do: <libset includes="kernel32.lib advapi32.lib"/> when you don't need to conditionalize the libaries included. |