#11 cc task won't compile static libraries (on Solaris)

closed-out-of-date
nobody
None
5
2004-04-24
2002-07-11
No

on solaris with gcc, I can't create static libraries -
the linker runs, but no compiler. all libs are 8 bytes
long and contain this text " !<arch> "

Here is build source:
<taskdef name="cc"
classname="net.sf.antcontrib.cpptasks.CCTask" />
<typedef name="libset"
classname="net.sf.antcontrib.cpptasks.types.LibrarySet" />

<libset id="athlib">
<fileset dir="${libroot}/athlib" />
</libset>

<cc debug="true" link="static"
outfile="${lib.dir}/libath.a" >
<compiler name="gcc" if="isSolaris">
<compilerarg value="__UNIX__"/>
<compilerarg value="NO_WCHAR"/>
<compilerarg value="DEBUG"/>
</compiler>
<libset refid="athlib"/>
<fileset dir="${libroot}"
includes="${libroot}/athlib/*.cpp" />
<includepath location="${libroot}/**/*.h" />
</cc>
results:
only linker runs:
here is output -
makelib:
[cc] Linking "libath.a" because it does not exist.

Is this a problem with the product, or the docs - no
explanation of how to create libraries on unix with gcc.

Discussion

  • Stuart Swerdloff

    Logged In: YES
    user_id=177665

    I haven't tried using Ant for c c/c++ compilation yet,
    but cc/CC are not used for creation of libraries.
    ar is used for creating static libraries (lib*.a)
    and ld is used for creating dynamic libraries (lib*.so)

     
  • Curt Arnold

    Curt Arnold - 2004-04-22
    • summary: cc task won't compile static libraries --> cc task won't compile static libraries (on Solaris)
     
  • Curt Arnold

    Curt Arnold - 2004-04-24
    • status: open --> closed-out-of-date
     
  • Curt Arnold

    Curt Arnold - 2004-04-24

    Logged In: YES
    user_id=27193

    I ran the test-static target on samples/cppunit.ant on Solaris
    9 without seeing this issue. I was required to put the
    Solaris "ar" on the path beforehand by doing

    setenv PATH=%PATH:/usr/ccs/bin

    I assume that this problem got fixed by itself sometime over
    the last almost two years.

     

Log in to post a comment.