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

Author Topic: SFML linking issue in CLion (Windows 10)  (Read 1254 times)

0 Members and 1 Guest are viewing this topic.

thoosequa

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML linking issue in CLion (Windows 10)
« on: May 07, 2017, 02:00:53 pm »
Important: I fixed the issue. It was blatantly simple: I just copied the built .dlls from the SFML source to where CLion compiled the .exe to. I'll leave the message below in case someone stumbles into a similar issue

Hello all,

After successfully installing and using SFML on my Linux machine I wanted to give it a go on my Windows main desktop. Using the tutorial provided from the website I downloaded the SFML source from the latest master branch, and built it myself with cmake and MinGW-make using these settings:

(click to show/hide)

I then made a new project in CLion and with a lot of googling I hacked together this CMakeLists.txt

cmake_minimum_required(VERSION 3.7)
project(SFML_Game)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)

set(EXECUTABLE_NAME ${PROJECT_NAME})
add_executable(${EXECUTABLE_NAME} main.cpp)

#find SFML
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/)
set(SFML_INCLUDE_DIR "D:/CPP_Lib/SFML-rel/include/")
set(SFML_ROOT "D:/CPP_Lib/SFML-rel/")
find_package(SFML REQUIRED COMPONENTS audio graphics window system)
if(NOT SFML_FOUND)
    message(FATAL_ERROR "SFML couldn't be located!")
endif()
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
 

This took a lot longer than expected, but finally I am getting no more build errors from CMake, I more or less copied the RenderWindow sample from the website. However when trying to building and running it with this configuration

(click to show/hide)

I am getting this error when running the application:
Process finished with exit code -1073741515 (0xC0000135).

Finally, this is my MinGW32 setup, taken from the MinGW installer:

(click to show/hide)

If anyone knows whats up or has enountered a similar issue please do tell. I'd love to be able to get this running
« Last Edit: May 07, 2017, 02:17:39 pm by thoosequa »