Problem Including SDL in Codeblocks

Asked

Viewed 46 times

1

I’m downloading the mingw SDL from this website. I unzipped the zipped file and copied those folders:

bin, include, lib

And I taped them all together on the way to Codeblock

C: Program Files (x86) Codeblocks Mingw

I’ve already set up the Linker Settings part

-Imingw32

-Isdlmain

-ISDL

I set up the Search Directories part

C: Program Files (x86) Codeblocks Mingw include SDL2

And when will I take the test with this console code below:

#include <iostream>
#include <SDL.h>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Return me this error:

||=== Build: Debug in Test3 (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\libmingw32.a(main.o):main.c:(.text.startup+0xa7)||undefined reference to `WinMain@16'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

I can’t tell where the problem is, someone can help?

  • Tries to replace -ISDLmain -ISDL for -ISDL2main -ISDL2

  • Still giving the same problem

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.