#181 ld fails to export all dllexport'd syms

closed-fixed
Danny Smith
ld (17)
2004-02-24
2002-09-06
Greg Couch
No

mingw appears to be only able to export one class's
functions from a source file. Attached is example code
that demonstrates the bug. This is with the MinGW 2.0
distribution. The output I get from typing make is:

$ make
mingw32-g++ -shared -o good.dll -Wl,--out-implib,good.a
-DNO_PATHFINDER PathFind
er.cpp
Creating library file: good.a
mingw32-g++ -shared -o bad.dll -Wl,--out-implib,bad.a
PathFinder.cpp
Creating library file: bad.a
====== look in bad.a for pathFactory ======
missing!
====== look in good.a for pathFactory ======
00000000 I __imp___ZN3otf11PathFactory12pathFactory_E
00000000 I __nm___ZN3otf11PathFactory12pathFactory_E
00000000 I __imp___ZN3otf11PathFactory11pathFactoryEv
00000000 I __nm___ZN3otf11PathFactory11pathFactoryEv
00000000 T __ZN3otf11PathFactory11pathFactoryEv

The -D define removes the second class definition.
--export-all-symbols works, but since I've done all of
the work to put in __declspec(dllexport) everywhere,
I'd like to use it.

The code works with the Metrowerks compiler on Windows,
haven't tested with Visual C++ since it isn't very ISO
compliant.

- Greg

Discussion

  • Greg Couch
    Greg Couch
    2002-09-06

    test case

     
    Attachments
  • Luke Dunstan
    Luke Dunstan
    2002-09-07

    Logged In: YES
    user_id=30442

    This is a known bug with 'friend' declarations. A simple
    workaround is to change it to:

    friend class __declspec(dllexport) PathFactory;

    Now the output when you type 'make' will be as expected.

     
  • OROSZI Balázs
    OROSZI Balázs
    2003-07-05

    Logged In: YES
    user_id=796701

    Hi!

    Is this bug going to be fixed anytime soon, as it is already
    10 months old?
    I also have this problem, and it would be very useful for me
    if it worked properly!

    Thank you.
    --
    Greetings,
    Balzs

     
  • Robert Kausch
    Robert Kausch
    2003-07-10

    Logged In: YES
    user_id=87262

    Hello!

    I have the same problem with my smooth Class Library
    project -> http://www.sf.net/projects/smooth
    It works with MinGW 1.x and MSVC, but not with MinGW 2.0.
    The work around doesn't work for me.

    Greetings,
    Robert Kausch

     
  • Danny Smith
    Danny Smith
    2004-02-24

    Logged In: YES
    user_id=11494

    Fixed in GCC 3.3.3 mingw release candidate
    Dannt

     
  • Danny Smith
    Danny Smith
    2004-02-24

    • status: open --> closed-fixed