交叉编译,Crosstool,Makefile,libreadline [英] Cross Compiling, Crosstool, Makefile , libreadline
问题描述
我正在使用Simplicity Studio为我的应用程序生成代码.它会自动生成一个Makefile,我可以构建在我的主机pc amd64 ubuntu 16.02上运行的应用程序.
I am using Simplicity Studio to generate code for my application. It auto generates a Makefile and I am able to build application that runs on my host pc amd64 ubuntu 16.02.
现在,我想构建该应用程序,以便它可以在Raspberry Pi中运行.所以我安装了crostool-ng和Rpi crosstool.现在我对生成文件了解不多,但是我做了 make CC = arm-linux-gnueabihf-gcc
而不是 make
.
Now I want to build the application so it will work in Raspberry Pi. So I installed crostool-ng and also Rpi crosstool. Now I don't know much about make files but I did make CC=arm-linux-gnueabihf-gcc
instead of make
.
它在
严重错误:readline/readline.h:没有这样的文件或目录
fatal error: readline/readline.h: No such file or directory
我已经为armhf安装了 libreadline-dev 和 libreadline-dev .
I have already installed libreadline-dev and also libreadline-dev for armhf.
我这样做正确吗?我还需要进行其他更改吗?
Am I doing this the right way ? Do I need to make some other changes ?
我以前没有从事过大型项目,而且我对理解Makefile很不好.
I have not worked on big projects before and I am very bad at understanding makefiles.
我为Pi编译了简单的C程序,它们可以工作.
I have compiled simple C programs for Pi and they work.
推荐答案
也许您需要的是变量CROSS_COMPILE.
Maybe is the variable CROSS_COMPILE what you need.
工具链不仅是编译器.它们甚至是整个构建过程所需的基本bin utils.
The toolchain is not only the compiler. They are even basic bin utils needed for the whole build process.
尝试以下方法:
make CROSS_COMPILE=arm-linux-gnueabihf-
这篇关于交叉编译,Crosstool,Makefile,libreadline的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!