SDL and KDevelop 4, project setup
I'm getting "undefined reference to `SDL_Init'" when I try to run
Code:
#include <iostream> For example: KDevelop & SDL Quote:
How do I setup a SDL-project in KDevelop 4?:scratch: |
the automake manager was in kdevelop3 and is not part of kdevelop4
you can use cmake with kdevelop4, for cmake there is a find_sdl module. what you need is libSDL and libpthread so it usually it is enough to call g++ sdltest.cpp -lSDL -lpthread -o sdltest |
Quote:
I can see the cmake settings (project configuration) but I don't understand what you're recommending me to do. |
if you make a cmake project and add options via gui, kdevelop will alter your CMakeLists.txt file that belongs to the project
in this file there will be something like add_executable( yourprogram source.cpp file.cpp list.cpp ) linking via cmake works like that, add a line into the CMakeLists.txt (after add_executable): target_link_libraries( yourprogram SDL lpthread} that should do it. could be that there are some gui options in kdevelop, but I do not have installed it currently and so I can not check this |
Thread solved
You were right.
Enter the project folder and edit CMakeList.txt accordingly. This how it looks when it's done: Code:
project(test2) If you're new to KDevelop and get this error msg: "No valid executable specified" it means that you have to go Run>Configure Launches>. Select your project name to the left, press +, select the project again under project target. |
All times are GMT -5. The time now is 04:47 PM. |