Deady Online
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

Deady Online

Delivering information to the world. You are always welcomed to join!
 
AcasaPortalUltimele imaginiCăutareÎnregistrareConectare

 

 Sdl libraries linking for codeblocks, installation guide

In jos 
AutorMesaj
Oscuridao
Admin



Mesaje : 352
Data de inscriere : 27/08/2011
Varsta : 30
Localizare : Romania

sdl libraries for - Sdl libraries linking for codeblocks, installation guide Empty
MesajSubiect: Sdl libraries linking for codeblocks, installation guide   sdl libraries for - Sdl libraries linking for codeblocks, installation guide Icon_minitimeLun Mar 21, 2016 1:29 am

This guide is about how can you install sdl libraries for codeblocks:

Steps:
1. Download SDL Libraries for Mingw, from the internet, or from here.
2. Extract them somewhere on your drive.
3. Open Codeblocks, and go to Settings -> Compiler -> Search directories -> Compiler, and add there the location of your SDL library directory and the include folder.
For example:
C:\SDL2-2.0.3\i686-w64-mingw32\include\
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen13
4. Go to Settings -> Compiler -> Search directories -> Linker, and add there the location of your SDL library directory and the lib folder.
For example:
C:\SDL2-2.0.3\i686-w64-mingw32\lib\
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen14
5. Go to Settings -> Compiler -> Linker Settings -> Other linker options -> and add the following:
Cod:
-lmingw32
-lSDL2main
-lSDL2
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen15

or Go to Settings -> Compiler -> Linker Settings -> Link Libraries and click Add button, and write in the file window: mingw32 then click ok, press again Add button, write SDL2main then click ok, and press again Add button and write SDL2 and click ok. So it should look like this:
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen16

IMPORTANT: it needs to be this exactly order.

After you compile a file be sure you open the executable file in a directory with SDL.dll which you can find also in the SDL Library directory/bin.
Also if you encounter messages with missing dll files while trying to open your executable, download them from the internet.

While programming be sure you use: int argc, char** argv, as arguments for the main function, otherwise you will encounter compilation error something such us: undefined reference to SDL_main, if your compiler is friendly enough.
int main(int argv, char** args)
{
     Write here the code.
}
WITHOUT
Cod:
int argv, char** args
THESE PARAMETERS:
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen11
- this error will occure.

To use OpenGL add these lines to Settings -> Compiler -> Linker Settings -> Other linker options:
-lglu32
-lOpenGL32

These libraries are installed by the Codeblocks, so you don't need to download anything.

MISTAKES WHILE LINKING LIBRARIES:
sdl libraries for - Sdl libraries linking for codeblocks, installation guide Screen12
- this will provide errors. SDL libraries cannot be linked by browsing, selecting and adding the entire content of SDL2-2.0.3\i686-w64-mingw32\lib\/lib folder.

You can also try:
SDL Libraries for Mingw DevCpp
SDL Libraries for Microsoft Visual Studio
Sus In jos
https://deady.forumgratuit.ro
 
Sdl libraries linking for codeblocks, installation guide
Sus 
Pagina 1 din 1
 Subiecte similare
-
» Sdl libraries for devcpp mingw, installation guide
» Glew compilation and runtime errors fixes for all of them, a guide for linking libraries into ide software compiler
» Sdl libraries on microsoft visual studio 2010, 2012, 2013, installation guide
» How to add c++ 11 support in codeblocks with gnu gcc compiler, guide
» Codeblocks version 16.10 with gnu gcc compiler included and SDL2, glew, opengl, soil, development libraries (download)

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
Deady Online :: Others :: Altele!-
Mergi direct la: