From: Brian D. <br...@de...> - 2006-11-22 11:07:19
|
Yasir Niaz Khan wrote: > I want to make a dll using gcc on cygwin and use it in an MFC program > that i make in MSVC 2005. I have tried a dozen solutions from Internet > but none worked. I am able to use this dll in gcc applications and in C > programs that i compiled using MSVC compiler (cl), but i am unable to > even load the dll in an MFC application. Can anybody provide steps for > doing so, as i am not a big expert in dll's. It sounds like you're trying to mix C++ objects from different compilers (or even different branches of g++.) That won't work, because there are a great number of behind the scenes details in C++ that are compiler-implementation-specific. This is why each compiler has its own unique name mangling scheme, to prevent people from succeeding in linking foreign C++ objects. You can get a great deal of interoperability by restricting all interfaces to plain C or C++ with 'extern "C"' semantics but you can't directly mix C++. That's just how it goes. There's a page on this in the wiki. Also, Cygwin is a separate project with its own mailing list; it's not supported here. However, the Cygwin gcc and MinGW gcc are quite similar (and Cygwin's "gcc -mno-cygwin" is a shortcut for running the MinGW gcc binary in the Cygwin build environment.) Brian |