Reputation: 11
This is, I think, a complex problem I'm having. I'm just trying to set up a basic SDL project, I'm actually following this tutorial: http://lazyfoo.net/tutorials/SDL/01_hello_SDL/index2.php
Here is the full build log.
||=== Build: Debug in Drekirokr (compiler: GNU GCC Compiler) ===|
||Warning: corrupt .drectve at end of def file|
||error: ld returned 1 exit status|
||=== Build failed: 1 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
As you can see, it trows me there is an error, but there is nothing as far as I can understand. Of course the ld returned 1 exit status is an error, but I've searched for the line elsewhere, and it always has some other error, like a typo in a class name reference or something, and for them I think things get solved by solving that other error. The other line, corrupt .drective at end of def file, people having this log seem to be able to compile just fine. In my case, I can't. I've tried compiling anything else, and I've successfully compiled a "hello world" that uses only stdio.h for printf.
Here is my code
#include <SDL.h>
#include <stdio.h>
int main( int argc, char* args[] ) {
return 0;
}
I've added the search directories and the linker options. I just can't figure what's wrong.
Thanks in advance.
Upvotes: 0
Views: 1256
Reputation: 11
Thanks to @iksemyonov, found the answer here. SDL 2.0: linking error
Problem was that the actual Mingw libraries, headers and binaries are found at the i686-w64-mingw32 folder. Libs for instance are not at lib/x86. Those are for MSVC.
I actually wonder why the Mingw32 download not only includes the MSVC files, but also gets obscured by it (in my opinion, of course).
Thanks everyone!
Upvotes: 0
Reputation: 72
Ok I tried your code, it worked for me. Than I put the code just into one main.cpp file (so no project), and ld returned 1 exit status, too.
So try to put your code into a project file! That should solve it
Upvotes: 0