How do I cross-compile libsndfile for Arm/Raspberry Pi

雨燕双飞 提交于 2019-12-01 22:45:37

问题


I'm trying to get a working cross-compiler running under Linux (Debian squeeze amd64) but I can't seem to link my files with the installed libsndfile, I'm assuming I need to cross-compile the source to target the Raspberry-Pi and link to that version. But I can't seem to find straightforward instructions on doing the ./configure and make stage to compile to the target.

Note: I followed these steps: How do I build a GCC 4.7 toolchain for cross-compiling? to get the cross compiler built and using Eclipse.


回答1:


Ok, what you want to do is something which you probably cannot do within Eclipse.

Instead you need a terminal (eg xterm or gnome-terminal). The you need to run the configure script with something along the lines of:

./configure --prefix=$HOME/Arm --build=i386-linux --host=arm-unknown-linux-gnueabi

Watch the configure output to make sure that the configure script picks up the correct compiler and then do:

make && make install

When you then want to build something else that links against the Arm binaries, make sure they get the headers from $HOME/Arm/include and link against the library in $HOME/Arm/lib.

You should be able to find lots of documentation about cross compiling stuff that uses autoconf generated configure scripts on the net.



来源:https://stackoverflow.com/questions/11576168/how-do-i-cross-compile-libsndfile-for-arm-raspberry-pi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!