On 7/31/2015 7:45 AM, Óscar Fuentes wrote:
> Edward Diener <eldlistmaili...@tropicsoft.com>
> writes:
>
>>> I'm not sure this is a GCC bug. Does the linker error also occur when
>>> using static libraries, and when you dllexport the whole class as
>>> opposed to the functions you're explicitly defining?
>>
>> I have tried neither.
>>
>>> I believe this error is the same as your previous one: you're not
>>> dllexporting some implictly defined functions.
>>
>> Which ones ? You can see the code.
>
> The code is far from being a minimal example, so I didn't look at it
> all, but I see that the class ex_exception is not exported (EX_VISIBLE
> expands to "... __visibility__("default")..." and you set
> -fvisibility=hidden in your compile command). If your class has virtual
> members (as it seems the case) this is asking for trouble.
>

I am sorry but "this is asking for trouble" means absolutely nothing to 
me on a technical level.

>>> Now, if this is what MSVC
>>> does, perhaps GCC should be modified to follow that behaviour, but that
>>> is not certain at this point.
>>
>> It has to be a bug in either gcc or ld using mingw-64 unless you can
>> show me what is wrong with the code which produces the link errors.
>> Unless you tell me that gcc/ld on Windows is incapable of
>> exporting/importing individual member functions of a class rather than
>> the class as a whole this is a bug somewhere in gcc/ld.
>
> As you know C++ requires more info than the member address/signature to
> be able to call that method when it is virtual or there are some
> constructor/copier/etc involved.

No, I don't know what you are saying. Please be explicit and tell me 
what is lacking in my code.

I realize that you and Ruben are trying to help me figure out what I 
need to do in order not to get the link errors I have showed in my 
example, but unless you can be specific as to what has to change in the 
code, which looks perfectly fine AFAICS, vague comments are not going to 
solve this problem. I can assure you that I have enough C++ expertise to 
understand whatever specific things you want to tell me.

If you tell me that exporting/importing individual functions of a class 
does not work with mingw-64/gcc/ld when virtual inheritance is involved, 
that's fine but I would like to see some sort of docs explaining this. 
In fact if there are docs explaining all the rules of 
exporting/importing individual functions of a class using mingw-64/gcc I 
will be glad to read them.

The code example I have shown is a very simplified version of a much 
larger situation in the build of the Boost serialization library, but it 
shows the problem in building the library adequately. I am trying to 
help debug problems in building the wide character version of the 
library using gcc on Windows. I did not design and code any portion of 
the original library so I am trying to minimize any one-off changes that 
have to be made to build the wide character version of the library using 
mingw-64/gcc. Therefore I am very concerned at making the absolutely 
minimal number of changes necessary to get the code to build and work 
properly.



------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to