setup SDL2 in Code Blocks | C / C++ | SDL 2 | CodeBlocks

preview_player
Показать описание
This video demonstrates how to setup SDL2 in Code::Blocks 16.01. But the method is same for most of the versions.

2. Create a new project in Code::Blocks and goto Project-Build Options and configure include directory and libs directory.

3. Type following line in Linker Settings - Other linker settings:

-lmingw32 -lSDL2main -lSDL2

4. Click Ok.

That's it.

Рекомендации по теме
Комментарии
Автор

Ubuntu users, run this from terminal :
sudo apt-get install libsdl2-dev
Then go to Settings->Compiler->Linker Settings and add :
->SDL2main
->SDL2
To link libraries as also shown in this video.

Автор

fifth attempt to install SDL (five different tutorials on yt) and finally, after seeing this is all right! Thanks!

piotrbiay
Автор

error: ld.exe cannot find -lSDL2main
ld.exe cannot find -lSDL2

desktopnotfound
Автор

After a lot of searching i found a solution thanks for the video

FirasBc
Автор

It doesn't work for me :c at 4:08 it sais:
obj\Debug\main.o||In function `SDL_main':
undefined reference to `SDL_Init'
undefined reference to `SDL_Quit'

anderaginaga
Автор

Please what is the name of the music, it is so calm and I need it so much.
Thx for the tutorial btw dude

economix
Автор

WOOOW its working i am created new window thanks for this

iqbalshaikh
Автор

for me there is a light problem : there is no window opening after running, only "hello world" !

what's the matter ?

Gamer-svmz
Автор

The example does not want to work for me. Have 4 errors I can not explain directly or wants. Undefined Reference. I did everything as shown in the video.

havocklp
Автор

#include <iostream>
Fatal error: iostream: no such file or directory

fabrizioapuzzo
visit shbcf.ru