TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Craig Swanson
date: 1994-09-04 19:12:24
subject: C Set++ _Export with class = LINK386 L4023 warning

I've recently been converting some C++ libraries to DLL's using the _Export
specifier as follows:

    class   _Export     BitVector
    {
        // Other code goes here
    }

Two of the classes (out of around twenty) are giving me problems --when I
link the OBJ files to create the DLL using LINK386 (via C Set++ calling
it), I get L4023 warnings which are "export internal name
conflict" warnings.  The on-line documentation suggests renaming the
routines, but in some cases these routines are UNIQUELY named already! The
problem seems to happen more often with constructors and destructors. 
Since only one destructor is allowed per class by the C++ language, I don't
see how this can happen to destructors.  One of the constructors giving me
this problem is for a class which has two constructors with different
parameter lists.  Commenting out the other constructor that does not give
the L4023 warning does not get rid of the problem.

Besides generating a warning, the routines are not exported in the DLL
file.  Besides making the DLL useless, this also means the IMPLIB utility
doesn't generate import libraries which can fully resolve all external
links as they should.

I have tried other ways of using _Export by specifying it on particular
routines rather than on the entire class and also tried using #pragma
export() instead, but nothing gets rid of the problem.

For the time being, the workaround I have used is to specify that the
methods giving me these problems are to be inlined (via the C++ inline
keyword).  This gets rid of the problem, but I'd rather not have inline
expansion of some of these methods as they are not performance critical and
are not trivially short.

I have been using IBM C Set++ 2.1 with compiler CSD 10 applied, if that
makes any difference.


--- Maximus/2 2.01wb

* Origin: OS/2 Connection {at} Mira Mesa, CA (1:202/354)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 712/353 623 713/888 800/1
@PATH: 202/354 301 1 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.