2016-03-27 24 views
0

因此,在main.cpp中我有:的OpenGL在Visual Studio中不能使用清晰的彩色

#include <iostream> 

#include "SRC\Graphics\Headers\MakeWindow.h" 

int main() 
{ 
    if (!glfwInit()) 
    { 
     std::cout << "Failed to open GLFW" << std::endl; 
     std::cin.get(); 
     return -1; 
    } 
    std::cin.get(); 

    char name_LOL[10] = "Hi There"; 
    ENGINEG::Make_Window MyWindow(250, 500, name_LOL); 

    if (MyWindow.Is_Closed()) 
    { 
     std::cout << "Failed to open window" << std::endl; 
     std::cin.get(); 
     return -1; 
    } 

    glClearColor(0.2f, 0.3f, 0.8f, 1.0f); 
    MyWindow.Set_Window(); 
    while (true) 
    { 
     glClear(GL_COLOR_BUFFER_BIT); 
     glfwPollEvents(); 
     MyWindow.Update(); 
    } 

    std::cin.get(); 

    MyWindow.Colose_Window(); 

    if (!MyWindow.Is_Closed()) 
    { 
     std::cout << "Failed to close window" << std::endl; 
     std::cin.get(); 
     return -1; 
    } 

    std::cin.get(); 
    glfwTerminate(); 

    std::cout << "Done!" << std::endl; 
    std::cin.get(); 
    return 0; 
} 

在Makewindow.h GLFW是進口的,爲此OpenGL的應,但我仍然在使用的OpenGL得到這個錯誤功能。

錯誤LNK2019解析的外部符號__imp__glClearColor @ 16函數引用_main Game_Engine

+0

標題和庫是完全不同的東西。你是否爲鏈接器添加了所需的庫? –

回答

0

是否有GLFW功能的任何其它未解決的外部符號?您很可能不會在鏈接器設置中包含glfw3.lib。轉到project-> properties-> linker-> input->其他依賴項,並確保您擁有需要的所有內容(glfw3.lib,opengl32.lib)。

相關問題