MinGW linker confusion


Hi folks,

I have things linking nicely with VC9, so I have seen the light, but for a collaborative project requiring eclipse CDT/svn I am trying to get things working with MinGW.

I went to a bit of trouble to get mingw to build the juce_amalgamated lib file (with mingw), which I called libJUCEdebug.a and put in my D:/CS/MinGW/lib folder.

Now, with this command:

‘g++ -LD:/CS/MinGW/lib -oJuceTest.exe main.o -lJUCEdebug’

I get a lot like :

D:/CS/MinGW/lib/libJUCEdebug.a(juce_amalgamated.o): In function ZN4juce16initWin32SocketsEv': D:/CS/Workspace/JUCE/Debug/../juce_amalgamated.cpp:6010: undefined reference toWSAStartup@8’
D:/CS/Workspace/JUCE/Debug/…/juce_amalgamated.cpp:6012: undefined reference to `WSACleanup@0’

I did try to link with the VC9-compiled jucelib_static_Win32_debug.lib file but that failed similarly. I can’t think what to try next.


Theese symbols are from winsocket library. Try linking it also win mingw socket lib, i think jules wrote witch libs are required when doing this (somewhere in the docs)



A couple of other libs I needed to add though: gdi32 for the fonts and comdlg32 for something else.


i think that the whole mingw build system is very outdated and jules isn’t keeping it fresh, i can understand him though.


By the way, the whole point of the Amalgamated stuff is that you don’t have to make a lib, you can just add it to your project. That way you can do all your troubleshooting in one place.