Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-20-2007, 04:20 PM   #1
LQ Newbie
Registered: Jan 2007
Location: In your closet.
Distribution: Ubuntu Linux (6.10 Edgy Eft)
Posts: 3

Rep: Reputation: 0
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:
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:
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:
$ 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.
Old 01-24-2007, 06:52 PM   #2
LQ Newbie
Registered: Jan 2007
Location: In your closet.
Distribution: Ubuntu Linux (6.10 Edgy Eft)
Posts: 3

Original Poster
Rep: Reputation: 0
If the question was too vague, just say so?


dll, g++, library, mingw, static, windoze

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross-Compiling with glibc trek413 Linux - Software 0 08-24-2006 10:34 PM
Cross Compiling dosnlinux Programming 5 03-01-2006 12:12 PM
cross compiling cerin Linux - Software 1 02-11-2006 11:47 PM
cross-compiling? jon_k Programming 3 12-09-2004 10:36 AM
cross compiling with g++ hornofsalvation Linux - Newbie 2 10-09-2004 11:29 PM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration