编译选项
---------IDE掩盖下的天空
/***************************************
* gcc for c language
***************************************/
Single Source to Executable
$ gcc helloworld.c [-o howdy]
默认生成的名字a.exe
______________________________________
Source File to Object File
$ gcc -c helloworld.c [-o harumph.o]
默认生成的名字与原文件名一致,后缀为.o
-c告知不但保留object文件,而且忽略连接过程
______________________________________
Multiple Source Files to Executable
$ gcc hellomain.c sayhello.c -o hello
______________________________________
Preprocessing
$ gcc -E helloworld.c [-o helloworld.i]
默认不输出文件,若输出则为.i文件
-E把宏展开后的代码情况
____________________________________
Generating Assembly Language
$ gcc -S helloworld.c
-S生成hellowordl.s汇编语言文件
____________________________________
Creating a Static Library
1、生成.o文件
$ gcc -c hellofirst.c hellosecond.c
2、生成.a文件
$ ar -r libhello.a hellofirst.o hellosecond.o
注意静态库的命名规则
3、连接
$ gcc twohellos.c libhello.a -o twohellos
____________________________________
Creating a Shared Library
1、生成.o文件
$ gcc -c -fpic shellofirst.c shellosecond.c
-fpic 使得.o输出模块以地址可定向的方式产生。[pic:position independent code]
2、生成.so
$ gcc -shared shellofirst.o shellosecond.o -o hello.so
3、连接
$ gcc stwohellos.c hello.so -o stwohellos
注意:1、2可以合并为
$ gcc -fpic -shared shellofirst.c shellosecond.c -o hello.so
_____________________________________
Overriding the Naming Convention
$ gcc -xc helloworld.jxj -o helloworld
-xc对于C语言的源代码,默认后缀为.c,但别的后缀文件也可以当作c来用,那就要加-x选项
_______________________________________
Create a header file
$ gcc sayhello.c -aux-info sayhello.h
$ gcc *.c -aux-info prototypes.h
不过这样产生的头文件,包含的函数原型太多,除了用户自定义的函数外,标准库中的函数原型都列出来了
编译选项
---------IDE掩盖下的天空
/***************************************
* gcc for c language
***************************************/
Single Source to Executable
$ gcc helloworld.c [-o howdy]
默认生成的名字a.exe
______________________________________
Source File to Object File
$ gcc -c helloworld.c [-o harumph.o]
默认生成的名字与原文件名一致,后缀为.o
-c告知不但保留object文件,而且忽略连接过程
______________________________________
Multiple Source Files to Executable
$ gcc hellomain.c sayhello.c -o hello
______________________________________
Preprocessing
$ gcc -E helloworld.c [-o helloworld.i]
默认不输出文件,若输出则为.i文件
-E把宏展开后的代码情况
____________________________________
Generating Assembly Language
$ gcc -S helloworld.c
-S生成hellowordl.s汇编语言文件
____________________________________
Creating a Static Library
1、生成.o文件
$ gcc -c hellofirst.c hellosecond.c
2、生成.a文件
$ ar -r libhello.a hellofirst.o hellosecond.o
注意静态库的命名规则
3、连接
$ gcc twohellos.c libhello.a -o twohellos
____________________________________
Creating a Shared Library
1、生成.o文件
$ gcc -c -fpic shellofirst.c shellosecond.c
-fpic 使得.o输出模块以地址可定向的方式产生。[pic:position independent code]
2、生成.so
$ gcc -shared shellofirst.o shellosecond.o -o hello.so
3、连接
$ gcc stwohellos.c hello.so -o stwohellos
注意:1、2可以合并为
$ gcc -fpic -shared shellofirst.c shellosecond.c -o hello.so
_____________________________________
Overriding the Naming Convention
$ gcc -xc helloworld.jxj -o helloworld
-xc对于C语言的源代码,默认后缀为.c,但别的后缀文件也可以当作c来用,那就要加-x选项
_______________________________________
Create a header file
$ gcc sayhello.c -aux-info sayhello.h
$ gcc *.c -aux-info prototypes.h
不过这样产生的头文件,包含的函数原型太多,除了用户自定义的函数外,标准库中的函数原型都列出来了
分享到:
相关推荐
gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux kernel...
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。 可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux kernel...
gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf 是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux kernel...
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux...
gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux ...
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian hard-float, little-endian目标中的裸机程序、u-boot、...
gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux kernel...
交叉编译工具:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2 解压命令:tar jxvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2
windows最新版的gcc-arm-none-eabi-9-2020-q2-update-win32,外网下非常慢,不也不想收分,但是我需要分下载别的东西
arm-linux-gcc编译选项,包括相关参数的详细说明等等。
warning: gcc-c++-4.4.7-3.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY error: Failed dependencies: gcc = 4.4.7-3.el6 is needed by gcc-c++-4.4.7-3.el6.x86_64 libstdc++ = 4.4.7-...
gcc-arm-none-eabi编译链,包含windows下以及linux环境下的
gcc-core-6.3.0-1-mingw32-bin.tar.xz c语言编译库 gnu gcc
gcc-arm-none-eabi-9-2019-q4-major-win32 GCC compiler toolchain for ARM.
gcc-arm-none-eabi-10-2020-q4-major-win32.exe
交叉编译工具:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2 解压命令:tar jxvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2
gcc编译器20220506 082534 版本为:gcc-arm-none-eabi-10.3-2021.10-win32 配合文章:nordic52832 nordic使用gcc编译环境搭建和使用说明