Linux 搜索 -lSDL 时跳过不兼容的 /libSDL.a

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7925926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 06:53:44  来源:igfitidea点击:

skipping incompatible /libSDL.a when searching for -lSDL

clinux

提问by user598208

I am trying to "make" ioquake3 on IBM machine. But, I kept getting the "skipping incompatible /libSDL.a when searching for -lSDL" error. I am thee ultimate beginner at Linux, but not a quitter! I have no privileges to install any libraries, and our server admin is not responding for about a week now. So, I've been googling/testing for for a solution now. As the message said, the library that is on the system is incompatible. So, I went to the Ubuntu site, and downloaded SDL PPC library freshly. I uploaded, unpacked it into a designated folder. However, GCC doesn't know where those libraries are. So, I found something called "LD_LIBRARY_PATH="~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib" to tell GCC where my libraries are. However, everytime I do a "make", I do not my "export" folder in the list.

我正在尝试在 IBM 机器上“制作”ioquake3。但是,我一直收到“在搜索 -lSDL 时跳过不兼容的 /libSDL.a”错误。我是 Linux 的终极初学者,但不是放弃者!我没有安装任何库的权限,我们的服务器管理员现在大约一周没有响应。所以,我现在一直在搜索/测试解决方案。正如消息所说,系统上的库不兼容。所以,我去了 Ubuntu 网站,并新鲜下载了 SDL PPC 库。我上传,解压到指定文件夹。但是,GCC 不知道这些库在哪里。所以,我找到了一个叫做“LD_LIBRARY_PATH="~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib”的东西来告诉 GCC 我的库在哪里。但是,每次我做一个“制作”时,我不“出口”

Please help, even with a different way, just to fix my incompatible SDL library problem.

请帮助,即使以不同的方式,只是为了解决我不兼容的 SDL 库问题。

below is the output:

下面是输出:

<pre>rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean[7188]% echo $LD_LIBRARY_PATH
~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib
rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean[7189]% cd ~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib
rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib[7190]% ls
libSDL.a  libSDL.la  libSDL.so@  libSDLmain.a  libopenal.a  libopenal.so@  pkgconfig/
rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/zzz/pkgs/usr/lib[7191]%</pre>

<pre>rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean[7174]% make
make[1]: Entering directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean&#39;

Building ioquake3 in build/release-linux-ppc64:
  PLATFORM: linux
  ARCH: ppc64
  VERSION: 1.36
  COMPILE_PLATFORM: linux
  COMPILE_ARCH: ppc64
  CC: cc

  CFLAGS:
    -MMD
    -Wall
    -fno-strict-aliasing
    -Wimplicit
    -Wstrict-prototypes
    -pipe
    -DUSE_ICON
    -I/usr/include/SDL
    -D_GNU_SOURCE=1
    -D_REENTRANT
    -DUSE_OPENAL
    -DUSE_CURL
    -maltivec
    -Icode/SDL12/include
    -m64
    -DUSE_MUMBLE
    -DUSE_VOIP
    -DFLOATING_POINT
    -DUSE_ALLOCA
    -Icode/libspeex/include
    -DUSE_LOCAL_HEADERS
    -DPRODUCT_VERSION=&quot;1.36&quot;
    -DNDEBUG
    -O3
    -ffast-math
    -funroll-loops
    -fomit-frame-pointer

  LDFLAGS:

  LIBS:
    -ldl
    -lm

  Output:
    build/release-linux-ppc64/ioq3ded.ppc64
    build/release-linux-ppc64/ioquake3.ppc64
    build/release-linux-ppc64/baseq3/cgameppc64.so
    build/release-linux-ppc64/baseq3/qagameppc64.so
    build/release-linux-ppc64/baseq3/uippc64.so
    build/release-linux-ppc64/missionpack/cgameppc64.so
    build/release-linux-ppc64/missionpack/qagameppc64.so
    build/release-linux-ppc64/missionpack/uippc64.so

make[2]: Entering directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean&#39;
make[2]: `build/release-linux-ppc64/ioq3ded.ppc64&#39; is up to date.
LD build/release-linux-ppc64/ioquake3.ppc64
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc-linux-gnu/4.4.5/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc-linux-gnu/4.4.5/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
make[2]: *** [build/release-linux-ppc64/ioquake3.ppc64] Error 1
make[2]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean&#39;
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean&#39;
make: *** [release] Error 2
rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean[7175]% ls</pre>

采纳答案by Antti

LD_LIBRARY_PATHdetermines the search path for shared libraries on runtime. What you want is to say where the library is on compile time. You can use LDFLAGSfor this - with the -Lswitch you can set the search path for libraries: make LDFLAGS=-L/path/to/your/SDL.

LD_LIBRARY_PATH确定运行时共享库​​的搜索路径。您想要的是说明库在编译时的位置。您可以LDFLAGS为此使用- 通过-L开关,您可以设置库的搜索路径:make LDFLAGS=-L/path/to/your/SDL.

It may be the that the SDL binary you grabbed from Ubuntu may still not work, due to an incompatible version etc. In that case I suggest downloading and building SDL yourself.

由于版本不兼容等原因,您从 Ubuntu 获取的 SDL 二进制文件可能仍然无法运行。在这种情况下,我建议您自己下载和构建 SDL。