LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Cross-Compiling DLLs with Mingw32- Linking a Static Library (https://www.linuxquestions.org/questions/programming-9/cross-compiling-dlls-with-mingw32-linking-a-static-library-521238/)

KrayZier 01-20-2007 03:20 PM

Cross-Compiling DLLs with Mingw32- Linking a Static Library
 
Ok. I'm trying to cross-compile thesource code of a "module" for a game's proxy called Furnarchy2 in mingw-g++.

Each one of these modules are .dll files that must be linked to a furn.h header, and (the problematic) furn2.lib file. I've compiled simple .dlls using a couple example sources, but I cannot figure out how to link this Static Library to the DLL. Whenever I try to compile, I got:
Code:

collect2: ld returned 1 exit status
I've compiled these modules in Dev-C++ in Windoze and since that uses Mingw, I tried looking at it's compiler output. I only looked at the lines concerning g++, and skipped the make options (Maybe that was my mistake?). Anyways here's what I copied:
Code:

g++.exe -D__DEBUG__ -c entry.cpp -o entry.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -pg -g3
dllwrap.exe --output-def libTemplate.def --driver-name c++ --implib libTemplate.a entry.o  -L"C:/Dev-Cpp/lib" -lgmon "../../../../../../Program Files/Furnarchy2/furn2.lib"  -g3  -o Template.dll

I tried passing this stripped down version to my compiler, and I'm getting this:
Code:

$ i586-mingw32msvc-g++ -D_DEBUG__ -c entry.cpp furn2.h -pg -g3
$ i586-mingw32msvc-dllwrap --output-def libEntry.def --driver-name c++ --implib libEntry.a entry.o -L. -lgmon furn2.lib  -g3  -o Entry.dll

Can anyone help me? I've uploaded the folder containing the files here, with a small README file containing the "instructions" from the program's maker.

KrayZier 01-24-2007 05:52 PM

If the question was too vague, just say so?


All times are GMT -5. The time now is 11:09 PM.