Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How do I add extra lib search dirs (-L)?

Help
2004-11-25
2013-04-24
  • Our environment uses a 'backstop' model where libraries we need could either be in a developer's personal space or in the integration area.

    I'd like to say something like

    <libset pathref="path reference" libs="a,b,c" />

    I've tried specifyin dir="" but I can only get one directory on the command line that way. If I use a libset with an empty libs="" tag, the directory isn't added.

    How, then, can I cause multiple directories to be added portably, so that it works on both windows and unix (I don't want to have to use compilerArgs for this, since the structure is the same on both platforms).

    =Austin

     
    • <chirp> <chirp> <chirp>

      I hear crickets...

       
    • I have the same need.  So far I've figured out that if you do something like:

      ...
                  <!-- libraries to link with -->
                  <fileset dir="c:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib">
                      <include name="*.lib" />
                  </fileset>
                  <fileset dir="c:\Program Files\Microsoft Visual Studio 8\VC\lib">
                      <include name="*.lib" />
                  </fileset>
                  <fileset dir="c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib">
                      <include name="*.lib" />
                  </fileset>
      ...

      then I can grab all system libraries.  This is obviously not desirable because I'm hard coding the file extension.  I'm also not using the 'libset' or 'syslibset' tasks.  I've seen examples in other posts stating that you can do:

      ...
      <libset>
         <fileset dir="whatever" />
         ...
      </libset>
      ...

      but that doesn't work.  If you try you will get:

      "...libset doesn't support the nested "fileset" element..."

      Perhaps Austin and I are going about this the wrong way.  What I need is a way to feed the compiler task a list of directories, and if it needs a libraries (even if I haven't specified them) it can find them.  This would be like the global settings in VisualStudio.  Basically just a way around having to set the environment variable 'LIB' before running Ant.

      ~Caleb