问题
I am trying to install UltraStarDeluxe on a linux machine. The make
uses compile scripts generated by fpc (Free Pascal)
. On invoking make
, the following is the error+warning message before ld
exits:
/usr/bin/ld: warning: ../game/link.res contains output sections; did you forget -T?
/usr/bin/ld: cannot find -lSDL_image
/home/sriram/ultraDX/ultrastardx-1.1-src/src/ultrastardx.dpr(344,1) Error: Error while linking
/home/sriram/ultraDX/ultrastardx-1.1-src/src/ultrastardx.dpr(344,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
make[1]: *** [../game/ultrastardx] Error 1
make[1]: Leaving directory `/home/sriram/ultraDX/ultrastardx-1.1-src/src'
make: *** [all] Error 2
I know from here that the warning message ("did you forget -T") is a bug and has been removed. Here is my question:
Update:
1. I searched the internet some more and see that SDL stands for Simple Direct Media Layer. I installed the library and now, according to the question here, my /usr/local/lib
contains the following:
default.sfx libSDL-1.2.so.0.11.3 libSDL.la libSDL.so
libSDL-1.2.so.0 libSDL.a libSDLmain.a pkgconfig/
However, the errors, as mentioned above, are still there. How can I get rid of them?
Update 2:
@wormsparty: I got around the errors by doing an rpm -U SDL_image-1.2.10-1.i586.rpm
. I now get package SDL_image-1.2.10-1.i586 is already installed
. I also checked /usr/lib
and found the following libraries installed:
libSDL-1.2.so.0 libSDL-1.2.so.0.11.2 libSDL_image-1.2.so.0 libSDL_image-1.2.so.0.8.2 libSDL.so
Is this what I should be looking for?
回答1:
You are looking for SDL_image, which provides libSDL_image.so
. It is a seperate library.
Try and install that library. The package is usually named SDL_image
.
You can also grab it here: http://www.libsdl.org/projects/SDL_image/
Edit: About the difference between package X and X-devel:
Libraries are of the form lib${Name}.so.${Version}
. There can be subversions, too. The version is here to differenciate between incompatible versions, for example libpng 1.4 and 1.5 are not binary compatible.
When you link your program to your library, you could link to an exact version number (eg gcc test.c /usr/lib/libSDL_image-1.2.so.0.8.2
directly), but you usually don't really care about the exact version number, this is why we create a dynamic link: libSDL_image-1.2.so
. This link will point to the exact version number.
Usually, on distributions, users who only want runtime files need neither header files, nor those dynamic links. Before, you probably had libSDL_image-1.2.so.${some_number}
in /usr/lib, but the libSDL_image-1.2.so
dynamic link was missing. It is provided by the SDL_image-devel
packages.
来源:https://stackoverflow.com/questions/7482400/linking-sdl-image-errors