Hello
So this is what i did:
from the SFML website download page, I:
- Downloaded the SFML library: SFML 2.4.0 built with GCC 6.1.0 MinGW (SEH) - 64-bit
- Downloaded MinGW Builds 6.1.0 (64-bit) (and use it as the toolchain in CLion)
I put them both in a folder, this folder also contains a folder name Project which contains my sources and CLion settings
This is my main.cpp:
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
int main(int argc, char* argv[]) {
cout << "test" << endl;
sf::Window window(sf::VideoMode(800, 600), "myproject");
while (window.isOpen()) {
sf::Event Event;
while (window.pollEvent(Event)) {
if (Event.type == sf::Event::Closed)
window.close();
}
window.display();
}
}
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.6)
set(PROJECT_NAME myproject)
project(${PROJECT_NAME})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
#sfml
set(SFML_DIR "${PROJECT_SOURCE_DIR}/../SFML-2.4.0")
set(SFML_ROOT ${SFML_DIR})
set(CMAKE_MODULE_PATH "${SFML_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
include_directories(${SFML_INCLUDE_DIR})
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
it compiles without error:
"C:\Program Files (x86)\JetBrains\CLion 2016.2.2\bin\cmake\bin\cmake.exe" --build C:\Users\SushiSalami\.CLion2016.2\system\cmake\generated\Project-edb1033a\edb1033a\Debug0 --target myproject -- -j 4
-- Found SFML 2.4.0 in D:/Development/C-C++/myproject/SFML-2.4.0/include
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/SushiSalami/.CLion2016.2/system/cmake/generated/Project-edb1033a/edb1033a/Debug0
[ 50%] Building CXX object CMakeFiles/myproject.dir/main.cpp.obj
[100%] Linking CXX executable myproject.exe
[100%] Built target myproject
but when i run, the application crash directly without any error except the exit code that is different from 0:
Process finished with exit code -1073741515 (0xC0000135)
"
Ofc i googled this but i can't find anything revelant
Thank you