Page 1 of 1
Posted: Fri May 25, 2018 11:02 pm
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.
Posted: Sat May 26, 2018 7:57 pm
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
Posted: Sat May 26, 2018 8:56 pm
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
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?
Posted: Sun May 27, 2018 11:57 pm
Just the name
The "-l" will be added by CodeLite
Posted: Mon May 28, 2018 3:58 am
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.