|
From: Brian D. <br...@de...> - 2007-04-06 22:09:47
|
Chr...@in... wrote: > Maybe this is the wrong mailing list for this question: is there a way > to 'convince' Visual Studio to generate interoperable DLLs which than > can be accessed by g++? Some compiler flags or some specific export > statements. I have access to the DLL sources and could therefore do some > slight modifications if it were of any use. This is just one of the inherent properties of C++. The language leaves so much for the compiler to do "behind the scenes" that there is a tremendous amount of implementation-specific behavior. The reason that symbol mangling was invented (AFAIK) was precisely so that each compiler could differentiate itself from other compilers with different ABIs, so that there was no chance that two implementations' objects could ever be accidently linked. And, it's not just VC++ and g++ that have different ABIs, it's even different versions of the same compiler. For example, the gcc ABI changed between 2.95 and 3.0, and again with 3.3, and again with 4.x. So if you have a C++ library compiled with g++ 3.2 you can't use any other version of g++ to write code that uses/links with this lib. This is one of those things about C++ you can't change. Brian |