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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>:

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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux