I'm needing to add SDL2 to Code-Lite so that I can finish up a C++ course I'm taking online.
Is there any instruction on how to go about adding external libraries to Code-Lite?
Any help on this is appreciated.
I've already placed the dll file in my mingw bin folder and the include and lib folder contents are copied into the mingw structure, but I'm not sure about setting environment variables for the compiler using code-lite.
SDL2
-
- CodeLite Curious
- Posts: 8
- Joined: Thu May 24, 2018 3:51 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: SDL2
You should not mix your own DLLs (i.e. SDL ) with the installation of MinGW.
You should edit the project settings for this:
Right click on the project icon and select 'Settings->Compiler->Include paths' and set there the path to the .h files
Right click on the project icon and select 'Settings->Linker->Libraries Search Paths' and set there the path to the .dll/.a files
Right click on the project icon and select 'Settings->Linker->Libraries' and set there the *name* of the .dll/.a files
You should edit the project settings for this:
Right click on the project icon and select 'Settings->Compiler->Include paths' and set there the path to the .h files
Right click on the project icon and select 'Settings->Linker->Libraries Search Paths' and set there the path to the .dll/.a files
Right click on the project icon and select 'Settings->Linker->Libraries' and set there the *name* of the .dll/.a files
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Thu May 24, 2018 3:51 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: SDL2
thanks a lot, Eran...i had been looking for settings on the top main menu.
By "names" for the libraries, do you mean this? ... -lmingw64;-lSDL2main;-lSDL2
[edit/update]
SDL2main; SDL2 seems to work - just have one error left, an undefined reference to winmain - maybe because i'm running the example on a console project?
again, thx!
By "names" for the libraries, do you mean this? ... -lmingw64;-lSDL2main;-lSDL2
[edit/update]
SDL2main; SDL2 seems to work - just have one error left, an undefined reference to winmain - maybe because i'm running the example on a console project?
again, thx!
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: SDL2
Just the name
e.g. "SDL2"
The "-l" will be added by CodeLite
e.g. "SDL2"
The "-l" will be added by CodeLite
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Thu May 24, 2018 3:51 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: SDL2
Thx -- I did finally get SDL2 working. IIn additon to following your guidance to the letter, I had to add and include for windows.h and change the int main as indicated by the attached image. Doing it this way worked with no further erros.
You do not have the required permissions to view the files attached to this post.