I´m trying to use GLFW witth Clion (the Jetbrains IDE), i configured the CMakeLists.txt getting help from other project, but compiling this project y have some troubles.
this is my output console error: http://ift.tt/2mjVzTC
This is my source tree: http://ift.tt/2lE2NxE
this is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.6)
project(TestGLFW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lmingw32")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${PROJECT_SOURCE_DIR}/lib)
set(SOURCE_FILES main.cpp)
add_executable(TestGLFW ${SOURCE_FILES})
target_link_libraries(TestGLFW mingw32 glfw3)
And this is my test source:
#include <GLFW/glfw3.h>
int main(void){
GLFWwindow* window;
if (!glfwInit())
return -1;
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window){
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while (!glfwWindowShouldClose(window)){
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
PS: i´m using mingw32
Help!!
Aucun commentaire:
Enregistrer un commentaire