导航:首页 > 文件教程 > 交叉编译c文件

交叉编译c文件

发布时间:2021-03-12 15:34:03

❶ 怎样使用交叉编译器编译单个C文件

$CC filename.c -o filename

❷ ubuntu下进行嵌入式C语言开发时,什么叫交叉编译为什么要交叉编译

交易编译就是将文件编译成目标机可执行的文件。
比如说:你在PC机上写一个helloword,怎么让它到开发板上运行,开发板上的指令跟PC机不到,就需要用到交叉编译工具,编译成开发板上能识别的指令。

linux怎样才能让所有用户使用arm-linux-gcc编译c文件

除设置环境变量外,还必须设置 gcc 环境的文件至少有 rx

❹ gcc交叉编译怎么找头文件及lib库的

是在specs里面读取的路径信息。
命令行中键入 gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver
bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe
xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu
ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-
awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre
ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio
ns --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

注意“--prefix=/usr” 以及“--libdir=/usr/lib ”
表示gcc ld as 等可执行文件安装在/usr/bin,而libc.a 等文件是在/usr/lib中。
解压缩交叉编译器时,也是要解压缩在在--prefix 指定的目录下。
比如 下载了arm-linux 的交叉编译器cross-3.3.2.tar.bz2,解压缩之后,运行 arm-linux-gcc -v
得到 --prefix=/usr/local/arm。那么就要把 bin lib 等所有的文件和文件夹到/usr/local/arm目录下。
否则到时候运行arm-linux-gcc hello.c会提示找不到stdio.h 或者 lib.so.6 等

HOWTO Use the GCC specs file

About Specs file
The "gcc" program invoked by users is a convenient front-end driver executable which will invoke other programs in the background such as cc1, as or ld to do its work according to the command line parameter given. A specs file is plain text used to control the default behavior for the "gcc" front-end. The specs file is usually built-in but for flexibility purposes, it can be overridden with an external version.
Basic Specs file modifications
CC will proce a specs file via the following command.
gcc -mpspecs > specs
You may use a text editor of your choice to inspect it. It may be confusing at first, but there are many places of interest. To use the specs file, invoke gcc with -specs= or place it at "/mingw/lib/gcc/mingw32//specs" to make GCC use it by default, where refers to the GCC version installed.
Adding include directories to the search path
& #160;he *cpp: section should be modified. It contains the following by default:
*cpp:
%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}
If "z:\libx\include" needs to be added to the GCC includes search path, it should be changed to the following
*cpp:
%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} -I/z/libx/include
Adding lib directories to the search path
& #160;he *link_libgcc: section should be modified. It contains the following by default:
*link_libgcc:
%D
& #160;f "z:\libx\lib" needs to be added to the GCC library search path, it should be changed to the following
*link_libgcc:
%D -L/z/libx/lib

❺ 交叉编译armlinuxgcc wchar.h: No such file or directory 不仅如此所有的C语言头文件都找不到

我的抄也是这个问题 交叉编译环境搭建后 arm-linux-gcc -v 显示
No such file or directory 使用which命令可以找到,环境变量没有问题,更详细的描述问题就是which找到的命令所在的目录下的所有命令都是同样的问题。

果然问题的解决点就在我用的是64位系统,使用 sudo apt-get install ia32-libs命令就可以解决

希望对你有所帮助!

❻ 在linux下写一份.c文件交叉编译让arm板屏幕全红。

出现的错误时什么样子的,贴出来分析一下。 最好是可以看一下喔网名吧,方便以后遇到问题了好解决

❼ Linux系统下采用ARM交叉编译器编译C文件,make后的文件放到ARM开发板下,为什么总是出现错误

出现的错误时什么样子的,贴出来分析一下。
最好是可以看一下喔网名吧,方便以后遇到问题了好解决

❽ 交叉编译除了C语言和linux基础还需要什么知识

交叉编译器其实没什么特殊的,你用gcc编译是一样的,只是最后结果不能在目标机上运行,在linux下可以执行而已。
需要了解mips指令集和交叉编译器的使用方法,也就是编写makefile

❾ C/C++源文件直接交叉编译生成.so文件供安卓应用程序调用,可以吗

Jni调用就行了,是要按规则写接口api,如果接口很多,也没法,那是你的业务问题,要重新设计业务逻辑。我们之前用的c++单独交叉编译一个进程,和安卓界面用tcp通信,如果接口多也以为着协议多,一样的。

❿ linux下如何把一个.c文件通过arm-none-eabi-交叉编译生成一个.bin的文件然后在qemu上运行

需要设置内核源码树,即你makefile中的KDIR
交叉编译的话,要设置
ARCH
CROSS_COMPILE
两个变量。
make就可以了。

阅读全文

与交叉编译c文件相关的资料

热点内容
re文件管理器创建链接 浏览:26
为何解压的cad文件安装不了 浏览:571
鲁大师没有硬件测试工具 浏览:337
监控上货软件app有哪些 浏览:496
e4a写出资源文件 浏览:306
太和文件夹 浏览:491
win10流氓软件文件夹删不掉怎么办 浏览:821
电脑wifi网络断断续续的 浏览:241
iphone信任黄网软件会中毒吗 浏览:884
外国的家具网站有哪些 浏览:604
pdf文件压缩mac 浏览:633
excel求两组数据平均值如何跳过0 浏览:822
滴滴司机app被删了怎么办 浏览:424
维修用哪个编程器 浏览:893
桌面上的文件怎么快速换名 浏览:18
哪个app记录身高 浏览:985
去哪儿网和大数据哪个好用 浏览:982
如何下载交警app 浏览:658
air压缩文件怎么打开游戏 浏览:233
html密码登录界面 浏览:229

友情链接