When linking a dll file with ld, where -la and -llib libraries used, order of
-la and -llib matters if these libraries are in .a and .lib formats, 
respectively. 
The link below[1] points to the setup that can be used to reproduce this
problem. Namely, passing "-la -llib" produces error 

./lib.lib(lib.obj):lib.c:(.text+0x4): undefined reference to `_wlib'

whereas passing "-llib -la" succeeds. There, wlib is exported by lib.lib, and
used by liba.a .

[1] http://karasik.eu.org/misc/ld-bug.tar

-- 
           Summary: ld: failure depending on order of -l libs
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: dmitry at karasik dot eu dot org
                CC: bug-binutils at gnu dot org
GCC target triplet: mingw/cygwin


http://sourceware.org/bugzilla/show_bug.cgi?id=6938

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to