2

I'm trying to use SFML on Clion (and MinGW as compiler suite): there isn't any problem during the building and linking process, i can also include SFML files whitout problems but when i run the project i get -1073741515 as exit code. At the moment my project is only a main.cpp file that i have copied from the sfml tutorial about managing a window

My cmake.txt

cmake_minimum_required(VERSION 3.6)
project(Survival_2D)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Modules" ${CMAKE_MODULE_PATH})

set(SOURCE_FILES main.cpp)
add_executable(Survival_2D ${SOURCE_FILES})

find_package(SFML REQUIRED system window graphics network audio)

if(SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(Survival_2D ${SFML_LIBRARIES})
endif()

main.cpp

#include <SFML/Window.hpp>

int main() {
    
    sf::Window window(sf::VideoMode(800, 600), "My window");

    while (window.isOpen()) {

        sf::Event event;
        while (window.pollEvent(event)) {
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }
    return 0;
}
Wippo
  • 853
  • 8
  • 22
  • Possible duplicate of [C++ running file with included library failes without compiling error (CMake / CLion)](http://stackoverflow.com/questions/40594359/c-running-file-with-included-library-failes-without-compiling-error-cmake-c) Please check out the answer to that question. FWIW, exit code -1073741515 (0xC0000135) is `STATUS_DLL_NOT_FOUND` – Eldar Abusalimov Nov 18 '16 at 14:35
  • I solved coping the sfml-dlls into my project folder. – Wippo Nov 18 '16 at 14:56

1 Answers1

1

Solved by adding sfml-dlls to project folder

Wippo
  • 853
  • 8
  • 22