From: cxf <che...@is...> - 2006-06-30 09:18:30
|
hello,everyone: in the minGW website:www.mingw.org,I follow the FAQ "How can an MSVC program call a MinGW DLL, and vice versa?",but the command seems wrong, the command is gcc -shared -o testdll.dll testdll.c \ -Wl,--output-def,testdll.def,--out-implib,libtestdll.a It did not generate the testdll.def and libtestdll.a. |
From: Michael G. <mg...@te...> - 2006-06-30 09:54:26
|
> hello,everyone: > in the minGW website:www.mingw.org,I follow the FAQ "How can an MSVC= =20 > program call a MinGW DLL, and vice versa?",but the command seems wrong, > the command is >=20 > gcc -shared -o testdll.dll testdll.c \ > -Wl,--output-def,testdll.def,--out-implib,libtestdll.a >=20 > It did not generate the testdll.def and libtestdll.a.=20 I daily use this command successfully, though I do write '-Wl,--output-def,testdll.def -Wl,--out-implib,libtestdll.a' but I think your version should work as well. Check out the MinGWiki under http://www.mingw.org/MinGWiki/index.php and there in particular the FAQ page under http://www.mingw.org/MinGWiki/index.php/FAQ Search for DLL and you'll find a couple of documents providing advice as to how deal with the various aspects of DLLs. If that doesn't solve your problem you should provide some sample code (i.e. testdll.c and corresponding headerfiles). HTH, best, Michael =2D-=20 Vote against SPAM - see http://www.politik-digital.de/spam/ Michael Gerdau email: mg...@te... GPG-keys available on request or at public keyserver |
From: Keith M. <kei...@to...> - 2006-06-30 13:36:34
|
Michael Gerdau wrote, quoting cxf: >> in the minGW website:www.mingw.org,I follow the FAQ "How can >> an MSVC program call a MinGW DLL, and vice versa?", but the >> command seems wrong, the command is >> >> gcc -shared -o testdll.dll testdll.c \ >> -Wl,--output-def,testdll.def,--out-implib,libtestdll.a >> >> It did not generate the testdll.def and libtestdll.a. > > I daily use this command successfully, though I do write > '-Wl,--output-def,testdll.def -Wl,--out-implib,libtestdll.a' > but I think your version should work as well. Works absolutely fine for me, using exactly the OP's syntax. You did realise that the trailing backslash on the first line means that the second line is a continuation of the first? If you are using MSYS, then bash will understand this, *provided* you *don't* add any extra whitespace after the backslash. If you use cmd.exe, then you must omit the backslash, and type *everything* on *one* line. Regards, Keith. |