在Ubuntu上编译OpenGL c ++ [英] compile OpenGL c++ on Ubuntu

查看:151
本文介绍了在Ubuntu上编译OpenGL c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我参加了一个计算机图形课程,并且需要用C ++编写OpenGL编程。我试图在家用电脑上运行我的程序(系统:ubuntu),但编译器给了我两个错误:

g ++ -Wall myProg.cpp -o runme -lglut -lGLU -lGLEW

(这是我们在课堂上编译它的方式,它有效)





/ usr / bin / ld :/tmp/ccJmqaFS.o:对符号'glClear'的未定义引用



//usr/lib/nvidia-331/libGL.so.1:添加错误符号:命令行中缺少DSO



我搜索了google quiete long中的错误,但是没有成功,所以我希望有人能给我一些提示。 />
(已安装Glut und Glew,直接渲染正在工作,glxgears也会做它应该做的事情,即显示齿轮,以不同颜色旋转)

谢谢!

Roman

Hello!
I attend a computergraphic class and have to some programming in OpenGL in c++. I tried to run my programm on my home pc (System: ubuntu) but the compiler gives me two errors:
g++ -Wall myProg.cpp -o runme -lglut -lGLU -lGLEW
(this is the way we compile it in class, and there it works)


/usr/bin/ld: /tmp/ccJmqaFS.o: undefined reference to symbol 'glClear'
and
//usr/lib/nvidia-331/libGL.so.1: error adding symbols: DSO missing from command line

I have searched for the errors in google quiete long, but without sucess, so I hope somebody has a hint for me.
(Glut und Glew is installed, direct rendering is working, glxgears also does what it should, i.e. shows the gears, rotating in different colors)
Thanks!
Roman

推荐答案

你在哪里安装了OpenGL库?您可能需要使用 -L 选项告诉链接器它们的位置。
Where have you installed the OpenGL libraries? You may need to use the -L option to tell the linker where they are.


这篇关于在Ubuntu上编译OpenGL c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆