Tangobos build problem

torhu no at spam.invalid
Sat Sep 6 09:30:32 PDT 2008


Simen Haugen wrote:
> Bill Baxter wrote:
>> On Thu, Sep 4, 2008 at 10:07 PM, Simen Haugen <simen at norstat.no> wrote:
>>> I'm using tango, but couldn't find any COM libraries. I thought about
>>> starting one myself, but as I have very simple needs with only one specific
>>> library I concluded it wasn't worth it.
>>>
>>> Then I found juno! Seemed simple enough, but it's phobos only.
>>> I installed tangobos, but I cannot seem to mix tango/phobos.
>>>
>>> .\std-c-stdlib.obj(std-c-stdlib)  Offset 00234H Record Type 0091
>>>  Error 1: Previous Definition Different : _EXIT_SUCCESS
>>> .\std-c-stdlib.obj(std-c-stdlib)  Offset 002ECH Record Type 0091
>>>  Error 1: Previous Definition Different : _EXIT_FAILURE
>>>
>>> But when I look at the files, I cannot see any difference at all...
>>>
>> 
>> I seem to recall those are the kinds of errors you run into when you
>> define constants in an extern(Windows) block as "const" instead of
>> using an enum.  The problem is that extern(Windows) things don't get
>> mangled with their package name, so if you have the same constant in
>> two places you will get a clash.  Enums doing use storage, though, so
>> they don't clash.  Maybe that will help you get to the root of the
>> problem.
>> 
>> --bb
> 
> But then I cannot see how anyone including stdlib is able to compile.
> Shouldn't both tangobos and tango change these to enums then?
> 
Then problem is when you try to link two libraries and both of them 
define the same constant, and they do it like this:

extern (C) const int EXIT_SUCCESS = 0;

Which results in both compiling to the symbol _EXIT_SUCCESS.  There's no 
point in using extern (C) with those constants, but both phobos and 
tango do it anyway, which causes trouble with tangobos.  Some of them 
are changed to enums now, but apparently not all.

When I was using tangobos, I just commented out the duplicate 
definitions in tangobos.  Or you can prefix them with extern (D), I 
guess. Or make them enums.


More information about the Digitalmars-d-learn mailing list