我使用Microsoft Visual Studio 2013中的GLFW和GLEW库在OpenGL中编写了一个程序。我遇到了错误

时间:2014-11-11 17:51:58

标签: c++ visual-studio-2013

用于检查扩展支持的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;
}

&GT;

'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\K_FPS.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dbghelp.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\D3DX9_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\d3dx10_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\d3dx11_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\D3DX8Wrapper.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\D3DCompiler_43.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17227_none_dad9452e5bcb7986\GdiPlus.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\comdlg32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Program Files (x86)\Razer\Razer Cortex\EasyHook32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dsound.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\comctl32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
DLL_PROCESS_ATTACH:[C:\Users\ak1132\documents\visual studio 2013\Projects\OpenGL\Debug\OpenGL.exe]CheckHookPath start
C:\Users\ak1132\documents\visual studio 2013\Projects\OpenGL\Debug\OpenGL.exe\dota 2 beta\dota.exeH:\Games\Naruto Shippuden Ultimate Ninja Storm RevolutionH:\Games\Borderlands The Pre-Sequel\Binaries\Win32H:\Games\Middle Earth Shadow of Mordor\x64CheckHookPath 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:\Windows\SysWOW64\ig4icd32.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'OpenGL.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
'OpenGL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
DLL_PROCESS_DETACH:[C:\Users\ak1132\documents\visual studio 2013\Projects\OpenGL\Debug\OpenGL.exe]The program '[5964] OpenGL.exe' has exited with code 0 (0x0).

1 个答案:

答案 0 :(得分:0)

我只能想到你得到这个错误的一个原因。也许你试图在Mac上同时运行你的项目,并且并行不支持非常好地在离散和集成视频卡之间切换(或者,你可能禁止在设置中使用离散卡)。因此,visual studio正试图在集成显卡上执行此代码,但openGL需要离散的代码。