0

I'm writing GameOfLife game in c with SDL2 but while compiling the files with CMake, it appears as an undefined reference to SDL functions:

enter image description here

What can be the problem and how can I fix it?

my CMakeLists.txt file:

cmake_minimum_required(VERSION 2.6)
project(GameOfLife)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -lrt -lpthread -lSDL2")

set(SOURCE_FILES
        main.c game.c func.h)

add_executable(GameOfLife ${SOURCE_FILES})
target_link_libraries(GameOfLife SDL2 SDL2main SDL2test glew32 glew32s ${OPENGL_gl_LIBRARY})

Ps I'm new in those development technics

edit: I'm using Ubuntu OS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.