凌阳udcc编译器
⑴ 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比较好,那里讲的全面些
⑵ 凌阳SPCE061A ECEError L0080: The external symbol "_printf" has not a public definition.
你把void main改成int main试试
运行结构没错 可能是你用的编译器不符合c的最新标准 因为标准c main不能是void的
⑶ 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是已经建立好的,已经存在的文件夹,上面这样表示编译后,
将生成的可执行文件安装拷贝到那个目录.
⑷ 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下编译。
⑸ 如何在Linux中安装cc和gcc编译器
方法如下:
一:挂载yum源,在终端输入指令:mount -o loop xxxx.iso /media/CentOS/
说明:xxxx.iso 是你的镜像文件名(注意路径正确)
/media/Centos/ 这个是挂载后文件地址,Centos是自己建的,也可以自己选着路径;
二:修改/etc/yum.repos.d/CentOS-Media.repo
1.首先进入文件: vi /etc/yum.repos.d/CentOS-Media.repo
2.修改文件如下:
[c6-media]
name=CentOS-$releasever - Media #名字而已
baseurl=file:///media/Centos #刚刚挂载镜像的地址
gpgcheck=1
enabled=1
gpgkey=file:///etc/media/Centos/RPM-GPG-KEY-CentOS-6
3. 退出保存。
4.输入指令:gcc -v 看看有没有反应。
⑹ unix下C编译器版本如何查看
常用的编译器有gcc, clang, c-compiler, xlc(AIX)等。一般他们会绑定到cc(软连接), 所以你可以查看下cc指向哪个连接,如果遵循GNU语法,那么看版本就是cc --version. 一个系统可以装多个版本的多种编译器,那么就可以看下$PATH变量中优先哪个生效?当然还有其他编译器,如intel 厂商的。可以看man XXXX 然后搜 version.
⑺ 编译器已经过期怎么办
原创 Sun Forte C编译器过期 重新申请免费license并安装的方法
1、从sun公司网站(网址:http://jsecom16.sun.com/ECom/EComActionServlet?StoreId=11&PartDetailId=FC9BS-602-TD99&TransactionId=Try&LMLoadBalanced=)
下载cc编译器的license的密码文件sparc.dat(下载的第一选项)。
(注意你必须有sun的注册帐户,免费注册)
2、用root用户登录需使用cc编译器的主机,进入如下目录;
/opt/SUNWspro/license_dir
3、用spart.dat中的内容替换sunpro.lic,node文件中的内容,保存退出,过期的cc编译器便可继续使用,使用期一个月。
⑻ 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
⑼ 有关armcc编译器的问题
如在如下子目录中:d:\new\01
可用下述命令:armcc d:\new\01\filename.c
[格式]有多长写多长,后边加个:\<文件名>
⑽ 凌阳A8平台上本来就装有Linux吗
需要交叉编译,PC上的编译器是gcc
cortex-a8平台有它自己的SDK,里面有交叉编译工具,用他的交叉编译工具编译好程序,再把程序一直到板子上去,就可以在板子上运行了可以用NFS将文件弄到板子上去,这个是比较主流也是比较方便的方法