Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error compiling node for optware - libv8.a: could not read symbols: File in wrong format

Getting this error cross compiling node.js for optware (slug) on Ubuntu 11.10.

/optware/cs05q1armel/builds/node/build/default/libv8.a(api.o): Relocations in generic ELF (EM: 3) /optware/cs05q1armel/builds/node/build/default/libv8.a: could not read symbols: File in wrong format

Using flags --without-snapshot --without-ssl --dest-cpu=arm for ./configure

arm-none-linux-gnueabi-g++ being correctly picked up as compiler, though maybe not for this lib?

Any pointers appreciated

like image 383
paulusm Avatar asked Jun 19 '26 03:06

paulusm


1 Answers

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.

from http://ugweb.cs.ualberta.ca/~rod/tutorials/error_messagesC.html in section "Errors That Elude Your Understanding"

like image 148
Martin Avatar answered Jun 22 '26 00:06

Martin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!