NoCol: Compilation error

Hello, In Ubuntu 20.04, when I try to compile it, I get the following error:

In file included from /tmp/NoCol/src/display_manager.cpp:1:
/tmp/NoCol/include/display_manager.hpp:4:10: fatal error: event_manager.hpp: No such file or directory
    4 | #include <event_manager.hpp>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/NoCol.dir/build.make:66: CMakeFiles/NoCol.dir/src/display_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:79: CMakeFiles/NoCol.dir/all] Error 2
make: *** [Makefile:87: all] Error 2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (15 by maintainers)

Most upvoted comments

@kritonpc : Try the following CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME NoCol)
project(${PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)

set (CMAKE_CXX_STANDARD 11)
set(SFML_DIR "" CACHE PATH "SFML lib path")
set(SFML_LIB_DIR "${SFML_DIR}/lib")
set(SFML_INC_DIR "${SFML_DIR}/include")

find_package(OpenGL)

set(SFML_LIBS "sfml-graphics"
    "sfml-window"
    "sfml-system"
    "freetype"
    "${OPENGL_LIBRARIES}"
)

file(GLOB source_files
	"src/*.cpp"
)

set(SOURCES ${source_files})

add_executable(${PROJECT_NAME} ${SOURCES})
add_definitions(-DSFML_STATIC)
target_include_directories(${PROJECT_NAME} PRIVATE "${SFML_INC_DIR}" "include")
target_link_libraries(${PROJECT_NAME} ${SFML_LIBS})