我是这一切的新手。 GLEW文件夹在我的Windows驱动器上,我正在尝试使用MSYS2的MinGW-w64构建它,以在OpenGL程序中使用。全新的MSYS2安装是最新的,并且从/MSYS2/mingw32.exe运行。安装到MSYS2中的唯一额外软件包是git,mingw-w64-x86_64-gcc和base-devel。
$ make SYSTEM=linux-mingw-w64
i686-w64-mingw32-gcc -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/linux-mingw-w64/default/shared/glew.o -c src/glew.c
i686-w64-mingw32-ld -shared -soname libglew32.dll --out-implib lib/libglew32.dll.a -o lib/glew32.dll tmp/linux-mingw-w64/default/shared/glew.o -nostdlib -lopengl32 -lgdi32 -luser32 -lkernel32
make: i686-w64-mingw32-ld: Command not found
make: *** [Makefile:122: lib/glew32.dll] Error 127
在Windows中,我可以查找并找到\ MSYS2 \ mingw32 \ bin \中的i686-w64-mingw32-gcc.exe,但在\ MSYS2 \中找不到i686-w64-mingw32-ld
如果我仅输入“ make”(我认为它使用的是其他SYSTEM =选项),则会显示以下信息:
$ make
gcc -fno-builtin -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/shared/glew.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll tmp/mingw/default/shared/glew.o -L/mingw/lib -nostdlib -lopengl32 -lgdi32 -luser32 -lkernel32
strip -x lib/glew32.dll
sed \
-e "s|@prefix@|/usr|g" \
-e "s|@libdir@|/usr/lib|g" \
-e "s|@exec_prefix@|/usr/bin|g" \
-e "s|@includedir@|/usr/include/GL|g" \
-e "s|@version@|2.1.0|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|glew32|g" \
-e "s|@requireslib@|glu|g" \
< glew.pc.in > glew.pc
gcc -fno-builtin -DGLEW_NO_GLU -DGLEW_STATIC -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/static/glew.o -c src/glew.c
ar rv lib/libglew32.a tmp/mingw/default/static/glew.o
a - tmp/mingw/default/static/glew.o
C:\MSYS2\mingw32\bin\ar.exe: creating lib/libglew32.a
strip -x lib/libglew32.a
gcc -fno-builtin -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/shared/glewinfo.o -c src/glewinfo.c
gcc -fno-builtin -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o bin/glewinfo.exe tmp/mingw/default/shared/glewinfo.o -Llib -lglew32 -L/mingw/lib -nostdlib -lopengl32 -lgdi32 -luser32 -lkernel32
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x33): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x54): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x5c): undefined reference to `strlen'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x90): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0xb8): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0xed): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x109): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x111): undefined reference to `strlen'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x12d): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x152): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x187): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1a4): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1ac): undefined reference to `strlen'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1dc): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e9): undefined reference to `fflush'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e46e): undefined reference to `sscanf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e492): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e4aa): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e4c9): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e500): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e51f): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e544): more undefined references to `strcmp' follow
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e596): undefined reference to `strtol'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e5b5): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e5df): undefined reference to `strcmp'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e620): undefined reference to `memset'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x1e716): undefined reference to `memset'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text+0x142): undefined reference to `fflush'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x1d): undefined reference to `__main'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x98): undefined reference to `fopen'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0xba): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0xcf): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0xe4): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x10b): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x127): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x160): more undefined references to `fprintf' follow
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x177d): undefined reference to `_imp____acrt_iob_func'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x178f): undefined reference to `fclose'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x17af): undefined reference to `_imp____acrt_iob_func'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x17bf): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x17d3): undefined reference to `_imp____acrt_iob_func'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x17e3): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x1808): undefined reference to `_imp____acrt_iob_func'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x181c): undefined reference to `fprintf'
tmp/mingw/default/shared/glewinfo.o:glewinfo.c:(.text.startup+0x1838): undefined reference to `_imp____acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:181: bin/glewinfo.exe] Error 1
因此在GLEW git上,recommended用来解决此错误,我以某种方式修改了Makefile,就像我所做的那样。之后,如果我仅运行“ make”,则将构建/ lib的目录,但是/ src中的目标文件不存在:
$ make
gcc -fno-builtin -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/shared/glew.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll tmp/mingw/default/shared/glew.o -L/mingw/lib -nostdlib -lopengl32 -lgdi32 -luser32 -lkernel32
strip -x lib/glew32.dll
sed \
-e "s|@prefix@|/usr|g" \
-e "s|@libdir@|/usr/lib|g" \
-e "s|@exec_prefix@|/usr/bin|g" \
-e "s|@includedir@|/usr/include/GL|g" \
-e "s|@version@|2.1.0|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|glew32|g" \
-e "s|@requireslib@|glu|g" \
< glew.pc.in > glew.pc
gcc -fno-builtin -DGLEW_NO_GLU -DGLEW_STATIC -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/static/glew.o -c src/glew.c
ar rv lib/libglew32.a tmp/mingw/default/static/glew.o
a - tmp/mingw/default/static/glew.o
C:\MSYS2\mingw32\bin\ar.exe: creating lib/libglew32.a
strip -x lib/libglew32.a
gcc -fno-builtin -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/shared/glewinfo.o -c src/glewinfo.c
gcc -fno-builtin -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o bin/glewinfo.exe tmp/mingw/default/shared/glewinfo.o -Llib -lglew32 -L/mingw/lib -lopengl32 -lgdi32 -luser32 -lkernel32
strip -x bin/glewinfo.exe
gcc -fno-builtin -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o tmp/mingw/default/shared/visualinfo.o -c src/visualinfo.c
gcc -fno-builtin -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -o bin/visualinfo.exe tmp/mingw/default/shared/visualinfo.o -Llib -lglew32 -L/mingw/lib -lopengl32 -lgdi32 -luser32 -lkernel32
strip -x bin/visualinfo.exe
如果在建议的修复程序之后运行“ make SYSTEM = linux-mingw-w64”,它将产生与之前相同的错误,并且没有任何构建。我要使用此选项进行构建,因为我将使用32位MinGW-w64编译需要GLEW的OGL项目。
问题:
为什么缺少i686-w64-mingw32-lb,我如何获得它?
为什么没有SYSTEM =标志的“ make”无法将.o文件构建到/ src中却没有给出错误?