小编Ved*_*als的帖子

链接器错误:对符号'glOrtho'的未定义引用

我在Ubuntu 13.04(*mesa-common-dev freeglut3-dev*)中安装了OpenGL软件包,并尝试运行示例程序.

#include "GL/freeglut.h"
#include "GL/gl.h"

/* display function - code from:
     http://fly.cc.fer.hr/~unreal/theredbook/chapter01.html
This is the actual usage of the OpenGL library. 
The following code is the same for any platform */
void renderFunction()
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glBegin(GL_POLYGON);
        glVertex2f(-0.5, -0.5);
        glVertex2f(-0.5, 0.5);
        glVertex2f(0.5, 0.5);
        glVertex2f(0.5, -0.5);
    glEnd();
    glFlush();
}

/* Main method - main entry point of application
the freeglut library does the window creation …
Run Code Online (Sandbox Code Playgroud)

opengl linker-errors

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

linker-errors ×1

opengl ×1