www.digitalmars.com         C & C++   DMDScript  

c++ - [bug] Linking to a library which depends onto a symbol in the exe

reply "Matthew" <admin.hat stlsoft.dot.org> writes:
In the soon-to-be-released Pantheios logging library, one of the libraries is
dependent on a symbol that the executable 
defines.

This is a no-brainer for all the other supported compilers, but I get the
following from DMC++:

        link -DELEXECUTABLE -NOLOGO 
.\test_api.debug.obj,"..\..\bin\pantheios.test_api--be.fprintf.dm.debug.exe",,..\..\lib\pantheios.core.dm.debug.lib+..\..\l
ib\pantheios.fe.simple.dm.debug.lib+..\..\lib\pantheios.be.fprintf.dm.debug.lib+..\..\lib\pantheios.bec.fprintf.dm.debug.lib
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

..\..\lib\pantheios.fe.simple.dm.debug.lib(fe_simple)
 Error 42: Symbol Undefined _FE_SIMPLE_PROCESS_IDENTITY
NMAKE : fatal error U1077: 'link' : return code '0x1'
Stop.

Is this a known 'feature' of DMC++/Optlink? Is a fix possible?

Cheers


-- 
Matthew Wilson

Author: "Extended STL", Addison-Wesley, 2006
    (http://www.extendedstl.com)
Author: "Imperfect C++", Addison-Wesley, 2004
    (http://www.imperfectcplusplus.com)
Contributing editor, C/C++ Users Journal
    (http://www.synesis.com.au/articles.html#columns)
Director, Synesis Software
    (www.synesis.com.au)
STLSoft moderator
    (http://www.stlsoft.org)

-----------------------------------------------------
Jul 25 2005
parent "Matthew" <admin.hat stlsoft.dot.org> writes:
More on this: If I change the definition in the executable's main source file
from

extern "C" const char FE_SIMPLE_PROCESS_IDENTITY[] = "test_api";

to

extern "C" const char *FE_SIMPLE_PROCESS_IDENTITY  = "test_api";

then it works (and DMC++ now appears to fully support Pantheios, which is
pretty nice news <g>). This definitely smells 
like a bug to me, though I concede there may be a rism of minutae in the
standard that I've overlooked which backs up 
DMC++'s behaviour in the matter.

Either way, if you can let me know whether DMC++ is correct, or whether it's
wrong and when a fix may be forthcoming, 
it'll help with the Pantheios release.

Cheers

Matthew


"Matthew" <admin.hat stlsoft.dot.org> wrote in message
news:dc2m0m$1n0q$1 digitaldaemon.com...
 In the soon-to-be-released Pantheios logging library, one of the libraries is
dependent on a symbol that the
 executable defines.

 This is a no-brainer for all the other supported compilers, but I get the
following from DMC++:

        link -DELEXECUTABLE -NOLOGO
 .\test_api.debug.obj,"..\..\bin\pantheios.test_api--be.fprintf.dm.debug.exe",,..\..\lib\pantheios.core.dm.debug.lib+..\..\l
 ib\pantheios.fe.simple.dm.debug.lib+..\..\lib\pantheios.be.fprintf.dm.debug.lib+..\..\lib\pantheios.bec.fprintf.dm.debug.lib
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 ..\..\lib\pantheios.fe.simple.dm.debug.lib(fe_simple)
 Error 42: Symbol Undefined _FE_SIMPLE_PROCESS_IDENTITY
 NMAKE : fatal error U1077: 'link' : return code '0x1'
 Stop.

 Is this a known 'feature' of DMC++/Optlink? Is a fix possible?

 Cheers


 -- 
 Matthew Wilson

 Author: "Extended STL", Addison-Wesley, 2006
    (http://www.extendedstl.com)
 Author: "Imperfect C++", Addison-Wesley, 2004
    (http://www.imperfectcplusplus.com)
 Contributing editor, C/C++ Users Journal
    (http://www.synesis.com.au/articles.html#columns)
 Director, Synesis Software
    (www.synesis.com.au)
 STLSoft moderator
    (http://www.stlsoft.org)

 -----------------------------------------------------

Jul 25 2005