我使用Microsoft Visual Studio 2013中的GLFW和GLEW库在OpenGL中编写了一个程序.我

I have written a program in OpenGL using the GLFW and GLEW libraries in Microsoft Visual Studio 2013.I am getting errors

本文关键字:程序 一个 OpenGL 库在 Visual Microsoft Studio 2013 GLFW 中的 GLEW      更新时间:2023-10-16

用于检查扩展支持的OpenGL程序

#include<iostream>
#include<cstdlib>
#include<glew.h>
#include<glfw3.h>
#define GLEW_STATIC 
using namespace std;
int main(int argc, char* argv[]){
    GLFWwindow *window;
    if (!glfwInit()) exit(EXIT_FAILURE);    //Exit if not initialized
    int w = 1024, h = 600;
    window = glfwCreateWindow(w, h, "glfw", NULL, NULL); //Create a window
    if (!window){
        glfwTerminate();
        exit(EXIT_FAILURE);
    }
    glewExperimental = true;        //Supports modern OpenGL
    GLenum glewError = glewInit(); //Initialize GLEW
    if (glewError != GLEW_OK){
        cout << "GLEW Error: " << glewGetErrorString(glewError)<<endl;
    }
    if (!GLEW_VERSION_2_1){
        cout << "Glew not supported" << endl;
        return false;
    }
    const GLubyte *p = glGetString(GL_VERSION);  //Check GL version
    cout << "Graphics Driver: " << p << endl;
    const GLubyte *q = glGetString(GL_SHADING_LANGUAGE_VERSION);
    cout << "SHader Version: " << q << endl;
    if (GLEW_ARB_vertex_array_object){
        cout << "genVertexArrays supported" << endl;
    }
    return 0;
}

>

'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)NVIDIA Corporationcoprocmanagerdetoured.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)NVIDIA CorporationcoprocmanagerNvd3d9wrap.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64setupapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64cfgmgr32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)NVIDIA Corporationcoprocmanagernvdxgiwrap.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64uxtheme.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64combase.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64winmm.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64winmmbase.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64devobj.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64dwmapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer CortexK_FPS.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64shlwapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64dbghelp.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer CortexD3DX9_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer Cortexd3dx10_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer Cortexd3dx11_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer CortexD3DX8Wrapper.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer CortexD3DCompiler_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsWinSxSx86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17227_none_dad9452e5bcb7986GdiPlus.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64psapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64comdlg32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:Program Files (x86)RazerRazer CortexEasyHook32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64dsound.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64ole32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64oleaut32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64comctl32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64shell32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64powrprof.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64SHCore.dll'. Cannot find or open the PDB file.
DLL_PROCESS_ATTACH:[C:Usersak1132documentsvisual studio 2013ProjectsOpenGLDebugOpenGL.exe]CheckHookPath start
C:Usersak1132documentsvisual studio 2013ProjectsOpenGLDebugOpenGL.exedota 2 betadota.exeH:GamesNaruto Shippuden Ultimate Ninja Storm RevolutionH:GamesBorderlands The Pre-SequelBinariesWin32H:GamesMiddle Earth Shadow of Mordorx64CheckHookPath end
CheckHookFullPath start
CheckFullPathHookMatch start
CheckFullPathHookMatch end
CheckHookFullPath end
**This app is not contained in hook (full)path, So we don't handle it**
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64ig4icd32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64version.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Unloaded 'C:WindowsSysWOW64version.dll'
'OpenGL.exe' (Win32): Loaded 'C:WindowsSysWOW64kernel.appcore.dll'. Cannot find or open the PDB file.
DLL_PROCESS_DETACH:[C:Usersak1132documentsvisual studio 2013ProjectsOpenGLDebugOpenGL.exe]The program '[5964] OpenGL.exe' has exited with code 0 (0x0).

我只能想到出现这些错误的一个原因。也许你正试图在mac上并行运行你的项目,而并行并不很好地支持在离散和集成视频卡之间切换(或者,也许,你禁止在设置中使用离散卡)。因此,visualstudio正试图在集成视频卡上执行此代码,但openGL需要离散的代码。

相关文章: