导航:首页 > 源码编译 > cc编译器参数

cc编译器参数

发布时间:2022-07-12 03:41:22

Ⅰ unix下makefile中cc-g-bnoquiet-brtl-bexpall-o是什么意思

cc 通常指的是编译器,你可以在makefile里查找cc所指代的具体编译器。貌似你所用的编译器为xlc
-g -bnoquiet -brtl -bexpall -o 这些指的是编译器的参数,具体的编译器有具体的解释基本相似,但有所不同

以GCC编译器为例,参数的意思分别为:

-o

制定目标名称,缺省的时候,gcc 编译出来的文件是a.out,很难听,如果
你和我有同感,改掉它,哈哈
例子用法
gcc -o hello.exe hello.c (哦,windows用习惯了)
gcc -o hello.asm -S hello.c
-g

只是编译器,在编译的时候,产生条是信息。
...
具体你可以查看 参考文献
man xlc

或者xlc --help 查看具体参数-bnoquiet -brtl -bexpall 的含义

Ⅱ makefile command的cc -c,cc -o是什么意思啊

CC
是一个全局变量,它指定你的Makefile所用的编译器,一般默认是gcc
你可以显示的指定,比如说
CC=gcc
-c
-o
都是gcc的参数
CC
-o相当于在中端中执行gcc
xx.c
-o
xx.o
想要了解更多makefile编写方法,可以下个文档看看,半天就能搞定。

linux下C编译器cc的参数详解

Linux 下面 cc 就是 gcc ……

你可以去 gcc.gnu.org 看看 gcc 的文档,参数多的头晕。
http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Invoking-GCC.html#Invoking-GCC

Ⅳ 如何在configure时,将编译参数传入,改变默认的编译器gcc成arm

按照INSTALL中的介绍,也是常用的方法,在configure的时候,加上–host=arm-linux,结果没有实现我们要的效果,没有将编译器从默认的
gcc改成arm-linux-gcc,编译器还是用的默认的gcc:
[crifan@localhost lrzsz-0.12.20]$ CFLAGS=-O2 ./configure –host=arm-linux
loading cache ./config.cache
………………..
checking for gcc… (cached) gcc
checking whether the C compiler (gcc -O2 ) works… yes
checking whether the C compiler (gcc -O2 ) is a cross-compiler… no
………………..
后来经过多次尝试,最后受默认的
CFLAGS=-O2 ./configure
进行配置所启发,想到,是否可以将CC参数传入到configure中,
结果证实,如果没有自己的cache-file,即时加了对的CC参数,也还是无法传入:
[crifan@localhost lrzsz-0.12.20]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure –host=arm-linux
loading cache ./config.cache
………………..
checking for gcc… (cached) gcc
checking whether the C compiler (gcc -O2 ) works… yes
checking whether the C compiler (gcc -O2 ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
………………..
而且,如果CC参数放在configure后面:
./configure CC=arm-linux-gcc
则不能识别:
[crifan@localhost lrzsz-0.12.20]$ CFLAGS=-O2 ./configure CC=arm-linux-gcc
configure: warning: CC=arm-linux-gcc: invalid host type
………………..
参数传递必须像
CFLAGS=-O2 ./configure
一样,将参数设置放在configure的前面:
CC=arm-linux-gcc./configure
才能识别的。
必须要自己制定自己的cache-file 然后用./configure进行新配置,加上CC参数,才会即时生效,编译器才可以变成我们要的arm-linux-gcc:
[crifan@localhost lrzsz-0.12.20]$ CC=arm-linux-gcc ./configure –cache-file=cache_file_0 –prefix=/usr/crifan/lrzsz
………………..
checking for gcc… arm-linux-gcc
checking whether the C compiler (arm-linux-gcc ) works… yes
checking whether the C compiler (arm-linux-gcc ) is a cross-compiler… yes
checking whether we are using GNU C… yes
………………..
否则,就无法将我们的CC参数传入了:
[crifan@localhost lrzsz-0.12.20]$ CC=arm-linux-gcc ./configure –prefix=/usr/crifan/lrzsz
………………..
checking for gcc… (cached) gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
………………..
[crifan@localhost lrzsz-0.12.20]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure –cache-file=cache_file_0
loading cache cache_file_0
………………..
checking for gcc… arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works… yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler… yes
checking whether we are using GNU C… yes
最好此处在加上–prefix=/usr/crifan/lrzsz,表示具体安装到哪里
[crifan@localhost lrzsz-0.12.20]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure –cache-file=cache_file_0 –prefix=/usr/crifan/lrzsz
loading cache cache_file_0
………………..
checking for gcc… arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works… yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler… yes
checking whether we are using GNU C… yes
………………..
其中,/usr/crifan/lrzsz是已经建立好的,已经存在的文件夹,上面这样表示编译后,
将生成的可执行文件安装拷贝到那个目录.

Ⅳ 【C语言编译器问题】code::blocks的设置问题

基本可以这样认为
实际上在GCC中
不管是C语言还是C++用的都是一个编译器(cc)!!!只是传经去的参数不同以及链接的静态库不同而已(ld)
我试过用GCC编译C++只需要加个参数-lstdc++即可...
因此如果你不慎输入了C++的代码,他应该会弹出链接错误的

Ⅵ Linux 下 cc 和 gcc 有和区别

linux基础也很重要

Ⅶ cc gcc编译器怎么使用

gcc --help可以看gcc的编译选项

常用的有
gcc -c xcxcx.c : -c 编译C代码,生成该文件的obj文件
gcc xcxcx.o -o dest : -o 链接各个obj文件,生成目标执行程序
-I : (这里是大写i) 表示头文件路径
-L : 表示库文件路径
-l : (这里是小写的L) 表示需要链接的库文件
-O: (这里是大写英文o) 表示优化参数
-WALL: 表示warning等级

这里是一句完整的话
g++ -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-static/lib -o Qt_V4L_ShowImage main.o myWidget.o v4lThread.o moc_myWidget.o moc_v4lThread.o -L/usr/local/Trolltech/QtEmbedded-static/lib -lQtGui -L/usr/local/tslib/lib -L/usr/local/Trolltech/QtEmbedded-static/lib -L/usr/local/lib -L/home/root/ffmpeg/lib -lts -lQtNetwork -lQtCore -lc -lgcc -lm -lrt -ldl -lpthread -lavcodec -lavformat -lavutil -lx264 -xvidcore -lcv -lhighgui -lcvaux -lcxcore

不过还是自己看一下gcc的help比较好,那里讲的全面些

Ⅷ CC和gcc是一样的编译器吗

cc是Unix系统的C Compiler,而gcc则是GNU Compiler Collection,GNU编译器套装。gcc原名为Gun C语言编译器,因为它原本只能处理C语言,但gcc很快地扩展,包含很多编译器(C、C++、Objective-C、Ada、Fortran、Java)。因此,它们是不一样的,一个是古老的C编译器,一个是GNU编译器集合,gcc里面的C编译器比cc强大多了,因此没必要用cc。
下载不到cc的原因在于:cc来自于昂贵的Unix系统,cc是商业软件。
Linux下的cc是gcc符号连接,可以通过$ls –l /usr/bin/cc来简单察看,该变量是make程序的内建变量,默认指向gcc。cc符号链接和变量存在的意义在于源码的移植性,可以方便的用gcc来编译老的用cc编译的Unix软件,甚至连makefile都不用改在,而且也便于Linux程序在Unix下编译。

Ⅸ GCC编译器的参数与空格

按照INSTALL中的介绍,也是常用的方法,在configure的时候,加上–host=arm-linux,结果没有实现我们要的效果,没有将编译器从默认的
gcc改成arm-linux-gcc,编译器还是用的默认的gcc:
[crifan@localhost
lrzsz-0.12.20]$
CFLAGS=-O2
./configure
–host=arm-linux
loading
cache
./config.cache
………………..
checking
for
gcc…
(cached)
gcc
checking
whether
the
C
compiler
(gcc
-O2
)
works…
yes
checking
whether
the
C
compiler
(gcc
-O2
)
is
a
cross-compiler…
no
………………..
后来经过多次尝试,最后受默认的
CFLAGS=-O2
./configure
进行配置所启发,想到,是否可以将CC参数传入到configure中,
结果证实,如果没有自己的cache-file,即时加了对的CC参数,也还是无法传入:
[crifan@localhost
lrzsz-0.12.20]$
CFLAGS=-O2
CC=arm-linux-gcc
./configure
–host=arm-linux
loading
cache
./config.cache
………………..
checking
for
gcc…
(cached)
gcc
checking
whether
the
C
compiler
(gcc
-O2
)
works…
yes
checking
whether
the
C
compiler
(gcc
-O2
)
is
a
cross-compiler…
no
checking
whether
we
are
using
GNU
C…
(cached)
yes
………………..
而且,如果CC参数放在configure后面:
./configure
CC=arm-linux-gcc
则不能识别:
[crifan@localhost
lrzsz-0.12.20]$
CFLAGS=-O2
./configure
CC=arm-linux-gcc
configure:
warning:
CC=arm-linux-gcc:
invalid
host
type
………………..
参数传递必须像
CFLAGS=-O2
./configure
一样,将参数设置放在configure的前面:
CC=arm-linux-gcc./configure
才能识别的。
必须要自己制定自己的cache-file
然后用./configure进行新配置,加上CC参数,才会即时生效,编译器才可以变成我们要的arm-linux-gcc:
[crifan@localhost
lrzsz-0.12.20]$
CC=arm-linux-gcc
./configure
–cache-file=cache_file_0
–prefix=/usr/crifan/lrzsz
………………..
checking
for
gcc…
arm-linux-gcc
checking
whether
the
C
compiler
(arm-linux-gcc
)
works…
yes
checking
whether
the
C
compiler
(arm-linux-gcc
)
is
a
cross-compiler…
yes
checking
whether
we
are
using
GNU
C…
yes
………………..
否则,就无法将我们的CC参数传入了:
[crifan@localhost
lrzsz-0.12.20]$
CC=arm-linux-gcc
./configure
–prefix=/usr/crifan/lrzsz
………………..
checking
for
gcc…
(cached)
gcc
checking
whether
the
C
compiler
(gcc
)
works…
yes
checking
whether
the
C
compiler
(gcc
)
is
a
cross-compiler…
no
checking
whether
we
are
using
GNU
C…
(cached)
yes
………………..
[crifan@localhost
lrzsz-0.12.20]$
CFLAGS=-O2
CC=arm-linux-gcc
./configure
–cache-file=cache_file_0
loading
cache
cache_file_0
………………..
checking
for
gcc…
arm-linux-gcc
checking
whether
the
C
compiler
(arm-linux-gcc
-O2
)
works…
yes
checking
whether
the
C
compiler
(arm-linux-gcc
-O2
)
is
a
cross-compiler…
yes
checking
whether
we
are
using
GNU
C…
yes
最好此处在加上–prefix=/usr/crifan/lrzsz,表示具体安装到哪里
[crifan@localhost
lrzsz-0.12.20]$
CFLAGS=-O2
CC=arm-linux-gcc
./configure
–cache-file=cache_file_0
–prefix=/usr/crifan/lrzsz
loading
cache
cache_file_0
………………..
checking
for
gcc…
arm-linux-gcc
checking
whether
the
C
compiler
(arm-linux-gcc
-O2
)
works…
yes
checking
whether
the
C
compiler
(arm-linux-gcc
-O2
)
is
a
cross-compiler…
yes
checking
whether
we
are
using
GNU
C…
yes
………………..
其中,/usr/crifan/lrzsz是已经建立好的,已经存在的文件夹,上面这样表示编译后,
将生成的可执行文件安装拷贝到那个目录.

Ⅹ gcc -g -o -c分别是什么意思

-c和-o都是gcc编译器的可选参数。

-c表示只编译(compile)源文件但不链接,会把.c或.cc的c源程序编译成目标文件,一般是.o文件。-o用于指定输出(out)文件名。不用-o的话,一般会在当前文件夹下生成默认的a.out文件作为可执行程序。

例如:

gcc -c test.c将生成test.o的目标文件

gcc -o app test.c将生成可执行程序app

gcc -c a.c -o a.o表示把源文件a.c编译成指定文件名a.o的中间目标文件(其实在这里,把-o a.o省掉,效果是一样的,因为中间文件默认与源文件同名,只是后缀变化)。

1、如果GCC不带-C参数,编译一个源代码文件(test.c)。那么会自动将编译和链接一步完成,并生成可执行文件。可执行文件可以有-o参数指定(test.o)

2、如果是多个文件,则需要先编译成中间目标文件(一般是.o文件),在链接成可执行文件,一般习惯目标文件都是以.o后缀,也没有硬性规定可执行文件不能用.o文件。

(10)cc编译器参数扩展阅读:

gcc:GNU编译器套件(GNU Compiler Collection)包括C、C++、Objective-C、Fortran、Java、Ada和Go语言的前端,也包括了这些语言的库(如libstdc++、libgcj等等)。GCC的初衷是为GNU操作系统专门编写的一款编译器。GNU系统是彻底的自由软件。此处,“自由”的含义是它尊重用户的自由。

基本用法:

-o output_filename,确定输出文件的名称为output_filename,同时这个名称不能和源文件同名。如果不给出这个选项,gcc就给出预设的可执行文件a.out。

-O,对程序进行优化编译、链接,采用这个选项,整个源代码会在编译、链接过程中进行优化处理,这样产生的可执行文件的执行效率可以提高,但是,编译、链接的速度就相应地要慢一些。

阅读全文

与cc编译器参数相关的资料

热点内容
喷油螺杆制冷压缩机 浏览:578
python员工信息登记表 浏览:376
高中美术pdf 浏览:160
java实现排列 浏览:512
javavector的用法 浏览:981
osi实现加密的三层 浏览:231
大众宝来原厂中控如何安装app 浏览:913
linux内核根文件系统 浏览:242
3d的命令面板不见了 浏览:525
武汉理工大学服务器ip地址 浏览:148
亚马逊云服务器登录 浏览:524
安卓手机如何进行文件处理 浏览:70
mysql执行系统命令 浏览:929
php支持curlhttps 浏览:142
新预算法责任 浏览:443
服务器如何处理5万人同时在线 浏览:250
哈夫曼编码数据压缩 浏览:425
锁定服务器是什么意思 浏览:383
场景检测算法 浏览:616
解压手机软件触屏 浏览:348