[英]Linking SDL_image errors
I am running into problems when linking SDL_image in gcc 3 on cygwin under Windows 7.我在 Windows 7 下的 cygwin 上的 gcc 3 中链接 SDL_image 时遇到问题。
I receive the following error:我收到以下错误:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lSDL_image
My makefile appears as this:我的 makefile 出现如下:
all: rabbit
rabbit: main.o rabbit.o renderer.o
g++ -o rabbit main.o rabbit.o renderer.o -lSDLmain -lSDL -lSDL_image
main.o: main.cpp rabbit.h
g++ -c main.cpp
rabbit.o: rabbit.cpp rabbit.h gameobject.h
g++ -c rabbit.cpp
renderer.o: renderer.cpp renderer.h
g++ -c renderer.cpp
clean:
rm -rf *o rabbit
I store SDL_image.dll, SDL_image.lib, jpeg.dll, libpng12-0.dll, libtiff-3.dll, and zlib1.dll in the directory with my executable. I store SDL_image.dll, SDL_image.lib, jpeg.dll, libpng12-0.dll, libtiff-3.dll, and zlib1.dll in the directory with my executable. SDL_image.h is also in the correct location. SDL_image.h 也在正确的位置。
Please help, this has been at fault for a few days now!请帮忙,这已经有几天了!
SDL_image is not part of the core SDL distribution. SDL_image不是核心 SDL 分发的一部分。 It must be installed separately.它必须单独安装。
Check if you have /usr/local/lib/libSDL_image.a
or the shared library installed.检查您是否安装了/usr/local/lib/libSDL_image.a
或共享库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.