有些“找不到”问题,但程序运行正常

时间:2011-06-18 23:30:57

标签: c++

经过一些非常狂热的混乱之后,我成功地设法用GLEW运行FreeGlue。

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/freeglut.h>
#define WINDOW_TITLE_PREFIX "Chapter 1"

int CurrentWidth = 800,
        CurrentHeight = 600,
        WindowHandle = 0;

unsigned FrameCount = 0;

void Initialize(int, char*[]);
void InitWindow(int, char*[]);
void ResizeFunction(int, int);
void RenderFunction(void);
void TimerFunction(int);
void IdleFunction(void);

int main(int argc, char* argv[])
{
        Initialize(argc, argv);

        glutMainLoop();

        exit(EXIT_SUCCESS);
}

void Initialize(int argc, char* argv[])
{
        GLenum GlewInitResult;

        InitWindow(argc, argv);

        GlewInitResult = glewInit();

        if (GLEW_OK != GlewInitResult) {
                fprintf(
                        stderr,
                        "ERROR: %s\n",
                        glewGetErrorString(GlewInitResult)
                );
                exit(EXIT_FAILURE);
        }

        fprintf(
                stdout,
                "INFO: OpenGL Version: %s\n",
                glGetString(GL_VERSION)
        );

        glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}

void InitWindow(int argc, char* argv[])
{
        glutInit(&argc, argv);

        glutInitContextVersion(3, 3);
        glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
        glutInitContextProfile(GLUT_CORE_PROFILE);

        glutSetOption(
                GLUT_ACTION_ON_WINDOW_CLOSE,
                GLUT_ACTION_GLUTMAINLOOP_RETURNS
        );

        glutInitWindowSize(CurrentWidth, CurrentHeight);

        glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);

        WindowHandle = glutCreateWindow(WINDOW_TITLE_PREFIX);

        if(WindowHandle < 1) {
                fprintf(
                        stderr,
                        "ERROR: Could not create a new rendering window.\n"
                );
                exit(EXIT_FAILURE);
        }

        glutReshapeFunc(ResizeFunction);
        glutDisplayFunc(RenderFunction);
        glutIdleFunc(IdleFunction);
        glutTimerFunc(0, TimerFunction, 0);
}

void ResizeFunction(int Width, int Height)
{
        CurrentWidth = Width;
        CurrentHeight = Height;
        glViewport(0, 0, CurrentWidth, CurrentHeight);
}

void RenderFunction(void)
{
        ++FrameCount;

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        glutSwapBuffers();
        glutPostRedisplay();
}

void IdleFunction(void)
{
        glutPostRedisplay();
}

void TimerFunction(int Value)
{
        if (0 != Value) {
                char* TempString = (char*)
                        malloc(512 + strlen(WINDOW_TITLE_PREFIX));

                sprintf(
                        TempString,
                        "%s: %d Frames Per Second @ %d x %d",
                        WINDOW_TITLE_PREFIX,
                        FrameCount * 4,
                        CurrentWidth,
                        CurrentHeight
                );

                glutSetWindowTitle(TempString);
                free(TempString);
        }

        FrameCount = 0;
        glutTimerFunc(250, TimerFunction, 1);
}

代码非常简单,它运行得很完美,但这显示有些代码无法找到错误。谁能建议我在哪里查看这个问题?

'OGL_test1.exe': Loaded 'E:\Visual studio 2010\Projects\OGL_test1\Debug\OGL_test1.exe', Symbols loaded.
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\freeglut.dll', Binary was not built with debug information.
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\glew32.dll', Binary was not built with debug information.
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\atiglpxx.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\atioglxx.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\aticfx32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\atiadlxy.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
'OGL_test1.exe': Loaded 'C:\Program Files (x86)\Internet Download Manager\idmmkb.dll', Binary was not built with debug information.
The thread 'Win32 Thread' (0x1444) has exited with code -1073741510 (0xc000013a).
The program '[5464] OGL_test1.exe: Native' has exited with code -1073741510 (0xc000013a).

2 个答案:

答案 0 :(得分:2)

这些不是错误,只是运行时无法找到各种DLL的调试信息的信息。别担心,不需要它们。

答案 1 :(得分:1)

您可以从Microsoft下载符号文件,请参阅

How to use a symbol server