在 Ubuntu 11.10 上为 optware (slug) 交叉编译 node.js 时出现此错误。
/optware/cs05q1armel/builds/node/build/default/libv8.a(api.o):通用 ELF 中的重定位 (EM: 3) /optware/cs05q1armel/builds/node/build/default/libv8.a: 无法读取符号:文件格式错误
为 ./configure 使用标志 --without-snapshot --without-ssl --dest-cpu=arm
arm-none-linux-gnueabi-g++ 被正确选择为编译器,但可能不适用于此库?
感谢任何指点
最佳答案
This problem is due to compiling XXXX.o on a different architecture machine. For instance, Sun workstations compile into SPARC machine code while our LINUX workstations compile into Intel x86 code. If you compile part of a project on one type of architecture and then try to compile the rest of the project on another type of architecture, when you go to make the final executable the linker/loader will NOT be able to read one of the parts of the project .o files to create an executable, thus the "could not read symbols: File in wrong format" error message. If you change machine architectures, or even operating system versions, while doing a project it is reasonable to clean/remove all the existing .o files and re-create the whole project on the current machine you are sitting at.
来自 http://ugweb.cs.ualberta.ca/~rod/tutorials/error_messagesC.html在“您无法理解的错误”部分
关于linux - 为 optware 编译 Node 时出错 - libv8.a : could not read symbols: File in wrong format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7706799/