Convert GCC under Cygwin Name Mangling to VC++ Name Mangling [solved]

Francisco J. Royo Santas 497328@unizar.es
Tue Dec 19 19:54:00 GMT 2006


Thanks to C. Faylor and all of you, I finally managed to access the functions
explicitly and works fine, after knowing that cygwin1.dll needs to be
initialized. The problem now is that cygwin blocks the stdout and stderr after
initializing, but it is a problem for cygwin mailing lists, not here

thanks to everyone :)

Quoting Christopher Faylor <cgf-use-the-mailinglist-please@gcc.gnu.org>:

> On Mon, Dec 18, 2006 at 04:02:09PM +0100, Francisco J. Royo Santas wrote:
>> Hello once again,
>>
>> I have tried many things. I will try to explain all of them.
>>
>> 1st:
>> ----
>> I tried to use the extern "C" and it did link. I created a simple
>> "mydll.dll"
>> with a "void myproc1() { return; }" and after compiling it with cygwin it
>> linked under VC++ .net but when I run the program and it has to run
>> "myproc1" I
>> get a Windows error-window ".. has encountered a problem and needs to
>> close. We
>> are sorry (LoL) for the inconvenience". I have even turned DEP off.
>>
>> 2nd:
>> ----
>> I tried to do a explicit dll linking. With the same mydll.dll I tried
>> using the
>> example provided by VC++ help for explicit linking. The "LoadLibrary" hangs.
>> When it is at that point the program freezes and does nothing else.
>
> You can't just link a Cygwin-created DLL into your program without also
> going through the type of initialization which is talked about in the
> Cygwin FAQ at the Cygwin web site.
>
> OTOH, if you don't need Cygwin's POSIX facilities, you might be able to just
> use MinGW's C compiler.
>
> Cygwin:  http://cygwin.com/
> MinGW: http://mingw.org/
>
> No matter what you do, as you apparently know, you will have to confine
> yourself to using C functions rather than C++ since the name mangling
> and other conventions are different between gcc and MSVC.
>
> cgf
>



Francisco J. Royo Santas



More information about the Gcc-help mailing list