Using SDL2 with CMake

前端 未结 12 871
野性不改
野性不改 2020-11-28 10:47

I\'m trying to use CLion to create a SDL2 project. The problem is that the SDL headers can\'t be found when using #include\'s.

My CMakeLists.txt file:



        
12条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 11:05

    You don't seems to have a CMake error whike generating your make file. But I think your problem is, the SDL Header are located in a subfolder named "SDL2".

    Change your CMakeLists.txt to include

    C:/SDL/SDL2-2.0.3/include/SDL2
    

    Instead of

    C:/SDL/SDL2-2.0.3/include
    

提交回复
热议问题