1

I am making a 2D Game Engine with C++ and I want to use Qt to create a Map Editor. The problem I'm facing is that I want to use the Game Engine in my Qt Application, so I linked the game engine with qt application as static library, but the engine uses also some libraries like SDL, OpenGL and Lua, so I have problem with my linkage, I got the "undefined reference to 'SDL_Init' in my Qt Application, and I cant solve the problem.

Here is the .pro file from the Engine where I am trying to link the SDL for example:

INCLUDEPATH += /usr/include/SDL2
LIBS += -L/usr/local/lib -lSDL2

but this seems not to work. To point out, when i was using CMake as build system, everything was working ok, and also i am working under Ubuntu enviroment.

pureofpure
  • 1,060
  • 2
  • 12
  • 31
  • Have you check the order of the libraries in the linker command line? When linking static libraries, only the symbols which are used are imported by the linker. The issue is that "which are used" means "which are used by the libraries or object files that are placed before in the command line". – Benjamin T Mar 04 '17 at 22:23

0 Answers0