Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ExtSol

Pages: [1]
1
General / Re: Linking problems
« on: December 08, 2021, 12:01:20 am »
Hy there,

I had the same fault as gordogordo, this sentence is help for me :)

Quote
... In any case, you just have to mention their name in the linker settings, and they will be found automatically...

Thank you Laurent

Here is my CMakeLists.txt, I'll leave my solution here to see if it helps anyone in the future:
Code: [Select]
cmake_minimum_required(VERSION 3.22)
project(TheProject VERSION 0.1.0)

set(CMAKE_CXX_FLAGS "-Wall -mwindows")
add_definitions(-DSFML_STATIC)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

#SFML
set(SFML_LIBS ${PROJECT_SOURCE_DIR}/SFML-2.5.1/lib)
set(SFML_INCS ${PROJECT_SOURCE_DIR}/SFML-2.5.1/include)

add_executable(${CMAKE_PROJECT_NAME} src/main.cpp)
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${SFML_INCS})

target_link_libraries(${CMAKE_PROJECT_NAME} ${SFML_LIBS}/libsfml-graphics-s-d.a ${SFML_LIBS}/libsfml-window-s-d.a ${SFML_LIBS}/libsfml-system-s-d.a opengl32 winmm)

Win10 x64 / VS Code

Pages: [1]