linux链接freeglut,FreeGLUT linking Issues in Linux

I am running Linux Mint 14.1 64-bit

I have installed the following libs:

mesa-common-dev,

freeglut3-dev,

libglew-dev

through the apt-get tool.

Here are my includes, located in my Main.h file:

#include

#include

#include

#include

#include

#include

#include

I checked that the libs installed correctly, they seem to be located in /usr/lib/x86_64-linux-gnu

and the headers in /usr/include/GL

I proceed to compile my Main.C file with the following flags:

g++ -Wall -Wextra -Weffc++ -Winit-self -Wmissing-include-dirs -Wswitch-default -switch-enum -Wunused-parameter -Wstrict-overflow=5 -Wfloat-equal -Wshadow -Wc++0x-compat -Wconversion -Wsign-conversion -Wmissing-declarations -Wstrict-null-sentinel -Woverloaded-virtual -Wsign-promo -Werror -pedantic -Wcast-qual -fno-pretty-templates -fmessage-length=80 -fdiagnostics-show-option -g -std=c++0x -pipe -frepo -c Main.C -o Main.o

Main.o is generated without any issues, then I try to create the binary:

g++ -I/usr/include -L/usr/lib/x86_64-linux-gnu -lGL -lglut -lGLU -lGLEW -lX11 -lm -lrt -lpng Main.o -o main

And receive the following errors:

Main.o: In function `init()':

/path/to/Main.C:12: undefined reference to `glClearColor'

Main.o: In function `initGLUT(int, char**)':

/path/to/Main.C: undefined reference to `glutInit'

/path/to/Main.C:21: undefined reference to `glutInitDisplayMode'

/path/to/Main.C:24: undefined reference to `glutInitWindowSize'

/path/to/Main.C:25: undefined reference to `glutCreateWindow'

/path/to/Main.C:28: undefined reference to `glutDisplayFunc'

/path/to/Main.C:31: undefined reference to `glutKeyboardFunc'

/path/to/Main.C:34: undefined reference to `glutMouseFunc'

/path/to/Main.C:37: undefined reference to `glutReshapeFunc'

/path/to/Main.C:40: undefined reference to `glutIdleFunc'

Main.o: In function `printFPS()':

/path/to/Main.C:96: undefined reference to `glutGet'

Main.o: In function `reshape(int, int)':

/path/to/Main.C:123: undefined reference to `glutPostRedisplay'

Main.o: In function `getTime()':

/path/to/Main.C:129: undefined reference to `glutGet'

Main.o: In function `idle()':

/path/to/Main.C:141: undefined reference to `glutPostRedisplay'

Main.o: In function `display()':

/path/to/Main.C:148: undefined reference to `glClearColor'

/path/to/Main.C:149: undefined reference to `glClear'

/path/to/Main.C:150: undefined reference to `glFlush'

/path/to/Main.C:151: undefined reference to `glutSwapBuffers'

Main.o: In function `main':

/path/to/Main.C:164: undefined reference to `glutMainLoop'

The program compiles and links on another Linux system though.

what could I be missing?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值