#124 g++ linker does not add runtime w/o other libs referenced

open
Curt Arnold
cpptasks (103)
5
2005-01-26
2005-01-26
Mark Donszelmann
No

The g++ linker (GppLinker) sets up the runtime library
(for gcc) in addImpliedArgs(...) but the method to add
those libraries to the set, addLibrarySets(...) is
never called if
the library does not at least refer to one external
library using
libset or syslibset (from CommandLineLinker).

version used: 1.0b3

Discussion

  • Logged In: YES
    user_id=329630

    Hi, here a patch for this bug. Must be applied in
    net\sf\antcontrib\cpptasks\compiler. Dmitri Khokhlov
    dkhokhlov@hotmail.com.

    --- CommandLineLinker.java 2006-02-11
    23:50:24.236435700 -0800
    +++ CommandLineLinker.java 2006-02-11
    23:55:05.929344100 -0800
    @@ -143,9 +143,7 @@

    String[] libnames = null;
    LibrarySet[] libsets =
    specificDef.getActiveLibrarySets(defaultProviders,1);
    - if (libsets.length > 0) {
    - libnames = addLibrarySets(task, libsets, preargs,
    midargs, endargs);
    - }
    + libnames = addLibrarySets(task, libsets, preargs,
    midargs, endargs);

    StringBuffer buf = new StringBuffer(getIdentifier());
    for (int i = 0; i < 3; i++) {

     
  • Logged In: YES
    user_id=252726

    I would really appreciate it, if this patch made it into
    the next release, since I just wasted a whole morning
    trying to find a way to link some trivial C++ code with
    cpptasks. Applying the patch finally made it work.

    Thanks!