0

i work on Windows x64 with cmake and Mscv compiler Version 19.28.29913.

I included SDL and SDL_image as submodules in my project. All works fine until i tried to build SDL_image into my project.

My CMakeLists.txt looks like following

...
#add SDL_image drectory
add_subdirectory(SDL_image)

add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2 SDL2::image)

The linker complains several LNK2019 and LNK2001 errors.

For instance that he cant find symbols for "longjmp" in Function "IMG_LoadPNG_RW"

Error LNK2019   not resolved external symbol "longjmp" in function "IMG_LoadPNG_RW".    C:\Dev\C++\Project\out\build\x64-Debug\Game C:\Dev\C++\Project\out\build\x64-Debug\IMG_png.c.obj    1   

I pulled SDL2 and SDL_image from SDL github reop.

Do i have to link additional libraries?

Does anyone know how to fix this?

  • Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Michael Chourdakis Jul 25 '21 at 20:29
  • No. I know that the linker can not resolve these symbols. But i dont know if i have to link additional dependencies (and which dependencies) or maybe i am missing something else. – LonelyDriver Jul 26 '21 at 06:25

0 Answers0