简体   繁体   English

编译OpenGL时GLUT库问题

[英]GLUT library problems while compiling OpenGL

I'm trying to compile a sample from a project, the following code is the makefile: 我正在尝试从项目中编译示例,以下代码是makefile:

CC = gcc 
MACHINE= $(shell uname -s)
#declaration des options du compilateur
#PG_FLAGS = -DOPENGL_1_5

ifeq ($(MACHINE), Darwin)
GL_LDFLAGS = -framework OpenGL -framework GLUT -framework Cocoa -framework 
Carbon
else
GL_LDFLAGS = -lopengl32 -lglu32 -lglut
endif

CFLAGS = -Wall 
LDFLAGS = -lm $(GL_LDFLAGS)
PROGNAME = palette
HEADERS = image.h

SOURCES = Main.c ppm.c fonctions.c

I tried: "mingw32-make" and i got: 我试过:“ mingw32-make”,我得到了:

process_begin: CreateProcess(NULL, uname -s, ...) failed.
 gcc  Main.o ppm.o fonctions.o -lm -lopengl32 -lglu32 -lglut -o  palette
 C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64- 
 w64-mingw32/bin/ld.exe: cannot find -lglut
  collect2.exe: error: ld returned 1 exit status
 Makefile:25: recipe for target 'palette' failed
 mingw32-make: *** [palette] Error

but i have the glut library installed and i am using windows 10 但是我已经安装了glut库并且我正在使用Windows 10

i have found the solution for this problem 我已经找到了解决这个问题的方法

GLUT library have been abandoned with the most recent version 3.7. GLUT库已被最新版本3.7放弃。 Also, GLUT's license is incompatible with some software distributions .... so i used freeGLUT insted of it and it works 另外,GLUT的许可证与某些软件发行版不兼容.....所以我使用由它安装的freeGLUT来工作

and there is the link to download it : 并有下载链接:

https://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ https://www.transmissionzero.co.uk/computing/using-glut-with-mingw/

goodluck evryone :) 祝你好运evryone :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM