Weave / export issue with Mingw

I am working on a common C ++ DLL using Netbeans and MinGW on Windows.

My first question is: will it change between MinGW and Microsoft Visual C ++? I read that mangling is a specific compiler - is that true? I need to get with MinGW the same thing that I would have with MVC ++, will it ever be possible?

I found using Dependency Walker that exported functions are also treated as C (and they are not exported as C in my code). Does it depend on the DepWalker restriction, or for some reason does MinGW make my library exportable as C? (I checked that with "export C" I no longer see the manipulation, and without it I see a name change (which is different from what is expected based on MVC ++), but I still see the "C" icon instead of "C ++ "

Here is the link:

g++.exe -static-libgcc -static-libstdc++ -shared -o my.dll -s 1.o 2.o ... no other.dll -static

Thanks in advance and best regards.

+4
source share
1 answer

Yes, the name mangling is compiler specific. It may even change between versions of the same compiler.

You should never expect anything about a mechanism and should treat it like a black box — never rely on it to be the same or different.

If you need a link between compilers, use extern "C" .

+6
source

Source: https://habr.com/ru/post/1340589/


All Articles