title: Linking issue with dev-c++ on Windows
body: <p>I'm taking over a C++ project developed with Dev-C++ (yeah, I know...): it compiles fine but it won't link and the error message is not very indicative:</p>
  
  <pre><code>Compiler: Default compiler
  Building Makefile: "S:\Spirale 2\spiral2\conditionnement\trunk2011\Makefile.win"
  Finding dependencies for file: S:\Spirale 2\spiral2\conditionnement\trunk2011\spirale2.cpp
  Finding dependencies for file: S:\Spirale 2\spiral2\conditionnement\trunk2011\sp_pulse.cpp
  Finding dependencies for file: S:\Spirale 2\spiral2\conditionnement\trunk2011\sp_cb.cpp
  Finding dependencies for file: S:\Spirale 2\spiral2\conditionnement\trunk2011\sp_daq.cpp
  Finding dependencies for file: S:\Spirale 2\spiral2\conditionnement\trunk2011\sp_rs232.c
  Executing  make...
  make.exe -f "S:\Spirale 2\spiral2\conditionnement\trunk2011\Makefile.win" all
  g++.exe -D__DEBUG__ obj/spirale2.o obj/sp_pulse.o obj/sp_cb.o obj/sp_daq.o obj/sp_rs232.o obj/Spirale2_private.res -o "Spirale2.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/gtk+-bundle_2.22.1-20101227_win32/bin" -L"C:/RSSI/lib/msc" -L"C:/RSSI/lib/bc" -L"C:/Dev-Cpp/gtk+-bundle_2.22.1-20101227_win32/lib" -L"C:/Dev-Cpp/libiconv-1.9.1.bin.woe32/lib" -mwindows -lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -lgdi32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lrssism  -g3 
  
  obj/spirale2.o: could not read symbols: Invalid argument
  collect2: ld returned 1 exit status
  
  make.exe: *** [Spirale2.exe] Error 1
  
  Execution terminated
  </code></pre>
  
  <p>I broke down the last instruction to the linker here (one line per option for readability) and ran it from the command line:</p>
  
  <pre><code>c:/Dev-Cpp/libexec/gcc/mingw32/3.4.2/collect2.exe 
  --subsystem windows 
  -Bdynamic 
  -o Spirale2.exe 
  c:/Dev-Cpp/lib/crt2.o 
  c:/Dev-Cpp/lib/gcc/mingw32/3.4.2/crtbegin.o 
  -LC:/Dev-Cpp/lib 
  -LC:/Dev-Cpp/gtk+-bundle_2.22.1-20101227_win32/bin
  -LC:/RSSI/lib/msc
  -LC:/RSSI/lib/bc
  -LC:/Dev-Cpp/gtk+-bundle_2.22.1-20101227_win32/lib
  -LC:/Dev-Cpp/libiconv-1.9.1.bin.woe32/lib
  -Lc:/Dev-Cpp/lib/gcc/mingw32/3.4.2
  -Lc:/Dev-Cpp/lib/gcc
  -Lc:/Dev-Cpp/mingw32/lib
  -Lc:/Dev-Cpp/lib
  obj/spirale2.o
  obj/sp_pulse.o
  obj/sp_cb.o
  obj/sp_daq.o
  obj/sp_rs232.o
  obj/Spirale2_private.res
  -lgtk-win32-2.0
  -lgdk-win32-2.0
  -lgthread-2.0
  -lgdi32
  -lole32
  -luuid
  -latk-1.0
  -lgdk_pixbuf-2.0
  -lpangowin32-1.0
  -lgdi32
  -lpango-1.0
  -lgobject-2.0
  -lgmodule-2.0
  -lglib-2.0
  -lintl
  -liconv
  -lrssism
  -lstdc++
  -lmingw32
  -lgcc
  -lmoldname
  -lmingwex
  -lmsvcrt
  -lgdi32
  -lcomdlg32
  -luser32
  -lkernel32
  -ladvapi32
  -lshell32
  -lmingw32
  -lgcc
  -lmoldname
  -lmingwex
  -lmsvcrt
  c:/Dev-Cpp/lib/gcc/mingw32/3.4.2/crtend.o
  
  obj/spirale2.o: could not read symbols: Invalid argument
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I thought it might have been a file with the wrong CPU architecture, but I've checked the .o files:</p>
  
  <pre><code>crt2.o:     80386 COFF executable not stripped - version 30821
  crtbegin.o: 80386 COFF executable not stripped - version 30821
  crtend.o:   80386 COFF executable not stripped - version 30821
  sp_cb.o:    80386 COFF executable not stripped - version 30821
  sp_daq.o:   80386 COFF executable not stripped - version 30821
  spirale2.o: 80386 COFF executable not stripped - version 30821
  sp_pulse.o: 80386 COFF executable not stripped - version 30821
  sp_rs232.o: 80386 COFF executable not stripped - version 30821
  </code></pre>
  
  <p>Any idea ? Thanks.
  Like I said, the project is old and only needs a few modifications, so I don't really want to upgrade everything !</p>