MIPS平台交叉编译libSDL的问题
我试图为我的 mips 平台编译 libSDL-1.2.14。
但它并不成功。
这些是我尝试过的步骤:
- export PATH=/opt/mips-4.3/bin:$PATH
- 进入 libSDL-1.2.14 源文件夹。
- 给出了“./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu”
- 执行了“make”命令
这是收到的错误:
cc1:警告:包括位置 “/usr/include” 不安全 交叉编译
./src/audio/dma/SDL_dmaaudio.c:在 函数“DMA_WaitAudio”: ./src/audio/dma/SDL_dmaaudio.c:167: 错误:在类中找不到寄存器 重新加载“asm”时出现“COP3_REGS”
./src/audio/dma/SDL_dmaaudio.c:167: 错误:“asm”操作数不可能 约束条件:* [build/SDL_dmaaudio.lo] 错误 1
但后来我通过给出以下命令重新配置了 make 文件:
- make clean
- ./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I /opt/mips-4.3/mips-linux-gnu/libc/usr/include/
- make
注意:/opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - 这是您可以找到的路径mips 平台的 select.h 文件。 它包含宏 FD_ZERO 和 FD_SET 的定义。
我仍然遇到同样的错误。
cc1:警告:包括位置 “/usr/include” 不安全 交叉编译
./src/audio/dma/SDL_dmaaudio.c:在 函数“DMA_WaitAudio”:
./src/audio/dma/SDL_dmaaudio.c:167: 错误:在类中找不到寄存器 重新加载“asm”时出现“COP3_REGS”
./src/audio/dma/SDL_dmaaudio.c:167: 错误:“asm”操作数不可能 约束条件:* [build/SDL_dmaaudio.lo] 错误 1
请帮助我提供一些有价值的指示。
谢谢,
森
I was trying to compile libSDL-1.2.14 for my mips platform.
But it was not successful.
These were the steps that I tried out :
- export PATH=/opt/mips-4.3/bin:$PATH
- Went inside the libSDL-1.2.14 source folder.
- Gave a "./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu"
- Executed the "make" command
This was the error received :
cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1
But then i reconfigured the make file by giving the following commands :
- make clean
- ./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I/opt/mips-4.3/mips-linux-gnu/libc/usr/include/
- make
NOTE : /opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - This is the path where you can locate the select.h file for the mips Platform.
It contains the definitions of the macros FD_ZERO and FD_SET.
Still I am getting the same error.
cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1
Please help me with some valuable pointers.
Thanks,
Sen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,不要将交叉编译器的路径设置为 PATH 的第一部分,而将其设置为最后部分:
这样更安全。其次,运行./configure --help以获取所有选项。如果它更聪明的话,该错误消息会说如下:
检查您需要设置哪些其他配置选项来告诉配置脚本在哪里可以找到 .h文件(包含)和目标的库。这些通常与您下载的交叉编译器一起提供。另外,您可能应该在运行 configure 之前将 CROSS_COMPILE 环境变量设置为交叉编译器前缀。前缀是交叉编译器中 gcc 之前的部分,假设您使用 GCC 作为交叉编译器。
First, don't set the path to the cross-compiler as the first part of your PATH, set it as last:
It's safer this way. Second, run ./configure --help to get all the options. What that error message would say if it was smarter is the following:
Check what other configure options you need to set to tell the configure script where to find the .h files (includes) and the libraries for your target. These usually come with the cross-compiler that you download. Also, you should probably set the CROSS_COMPILE environment variable to the cross-compiler prefix before running configure. The prefix is the part before gcc in a cross-compiler, assuming you're using GCC as your cross-compiler.