Linux C++开发环境
目标
口 I nux开发工具:gcc、g++、Make、gdb
Linux开发工具-gccg++
9cc概述
GCC:GNU编译软件合集, GNU Comp iler Col lect i on
主页http://gcc.gnu.org
Linux开发工具-g++
程序编译过程
常用的编译过程
g++- c mytoo l1.cpp/把源文件编译成目标文件,默认目标文件名为
mvtoo l 1. o
r++- o test test. o mytoo l1. o mytoo l2.0/把多个目标文件链接
成可执行文件,指定可执行文件名为test
编译多个文件
g+- o test test. cpp mytool1cpp mytool2.cpp/把3个源文件编译链
接成可执行文件test
Linux开发工具-gcc
库相关
os0:
动态链接库文件。a:静态链接库文件
使用库文件
g++-o he l lo -L/home/youname test a he l lo. c:
-L向GC0的库文件搜索路径中添加新的
目录
g++-o hel lo -Im he l lo. c
指定链接的库文件名