Failed link: Invalid argument when windows.h is enabled

I installed MinGW and Eclipse with CDT for development in C ++ on Windows. Everything works fine as long as I do #include <windows.h>. As soon as I do this, I get a linker error message c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid argumentin which the path at the beginning resolves C:/MinGW/mingw32/bin/ld.exe.

I have no idea what the error message is trying to tell me ... so please help me decrypt it.

+3
source share
2 answers

Since I actually disagree with Lol4t0 that this is too localized, here is an ugly answer: reinstalling g ++ solved the problem.

, , , , , ( ) ... , (2005). .

+1

, .

, -lgdi32 -lkernel32 -luser32, WinAPI, <windows.h>

Eclipse, (gdi32, kernel32, user32) :

Project Proprertsies → C/++ build → → GCC Linker → → " "

( eclipse cdt)

0

All Articles