cmake_minimum_required(VERSION 3.7)
project(untitled)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp)
set(SFML_ROOT "D:/Development/SFML-2.4.2")
add_executable(untitled ${SOURCE_FILES})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML REQUIRED COMPONENTS audio graphics window system)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(untitled ${SFML_LIBRARIES})
endif()
You're not linking main (https://www.sfml-dev.org/tutorials/2.4/start-vc.php).While that is a true statement, it has nothing to do with the linker error. ;)