XWindow + OpenGL,无法编译文件

XWindow + OpenGL, cant compile files

本文关键字:编译 文件 OpenGL XWindow      更新时间:2023-10-16

我想编译我的OpenGL + Xwindow C++程序,但是我收到错误:

g++: fatal error: no input files
compliation terminated.
./source/Linux_OpenGL.c: line 10: //: is catalogue
...typedef: command not found
...Bool command not found
...XSetWindowAttributes command not found
...Syntax error near '}'.

等等...

这是我的编译脚本:

$(g++ -Wall -pedantic -ansi) ./source/Linux_OpenGL.cpp ./source/render.cpp -o Linux_OpenGL -lX11 -lGL -lGLU -lXxf86vm

如何成功编译我的程序?

好吧,我首先不这样做:$(g++ -Wall -pedantic -ansi)

这是在告诉外壳:

"将g++ -Wall -pedantic -ansi的输出解释为脚本并执行它"。

这绝对不是你想要的。

仅使用

g++ -Wall -pedantic -ansi ./source/Linux_OpenGL.cpp ./source/render.cpp -o Linux_OpenGL -lX11 -lGL -lGLU -lXxf86vm