本文介绍了链接SDL_image错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7下的cygwin上的gcc 3中链接SDL_image时遇到问题。

I am running into problems when linking SDL_image in gcc 3 on cygwin under Windows 7.

我收到以下错误:

/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lSDL_image

我的makefile显示为:

My makefile appears as this:

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

SDL_image.dll,SDL_image.lib,jpeg.dll,libpng12-0.dll,libtiff-3.dll和zlib1.dll在我的可执行文件的目录。 SDL_image.h也在正确的位置。

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.

请帮助,这已经错了几天了!

Please help, this has been at fault for a few days now!

推荐答案

SDL_image 不是核心SDL分发的一部分。

SDL_image is not part of the core SDL distribution. It must be installed separately.

检查您是否拥有 /usr/local/lib/libSDL_image.a 或已安装共享库。

Check if you have /usr/local/lib/libSDL_image.a or the shared library installed.

这篇关于链接SDL_image错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:44