Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

final link failed: Invalid argument when including windows.h

I have set up MinGW and Eclipse with CDT for C++ developing on Windows. Everything works great until I #include <windows.h>. As soon as I do that, I get the linker error message c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid argument whereby the path at the beginning resolves to C:/MinGW/mingw32/bin/ld.exe.

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

like image 734
Matmarbon Avatar asked Feb 22 '26 03:02

Matmarbon


1 Answers

Since I actually don't agree to Lol4t0's opinion that this is too localized here is the ugly answer: Reinstalling G++ solved the problem.

I think the problem also could have been that I maybe forgot to install one of the parts listed here (where I got it from) for the first time... but now I recognize the link is completely deprecated (2005). So one should use another anyway.

like image 64
Matmarbon Avatar answered Feb 24 '26 16:02

Matmarbon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!