freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

c語言-gcc基礎培訓-資料下載頁

2025-01-10 11:37本頁面
  

【正文】 file ? option d – Delete a file from the archive ? option p – Print a list of files in the archive ? option q – Append files to the archive ? option r – Insert new files in the archive by replacing if a file already exists in the archive ? option t – Displaying contents of an archive ? option x – Extracting files from an archive 65 ranlib Utility The “ranlib” mand is used to create index entries inside an archive file. 示例: $ranlib staticlibname 等價于 $ar –s staticlibname 66 nm Utility used to list symbols used in an object file. 示例: $ nm s $ nm s 另外: –a option with the nm mand also shows the debug symbols. 67 objdump Utility ?f – Displaying Header Information ?h – Displaying Section Headers ?d – Disassembling a File ?a – Displaying Information about Library Files 68 size Utility The size utility displays sizes of each section in an object file. 示例: [root@boota] size text data bss dec hex filename 1015 232 24 1271 4f7 69 ldd Utility The ldd utility is very useful in finding out the dependencies of an executable on shared libraries. 示例: [root@boota] ldd = /lib/i686/ (0x4002c000) /lib/ =/lib/ (0x40000000) [root@boota] 70 建立自己的 GCC 編譯環(huán)境 ? 一個系統(tǒng)上如何同時存在并使用多個版本的 GCC編譯器? ? 建立目標目錄: – 在 gcc源代碼同一級目錄下(與源目錄 ${srcdir}是同級目錄) – % mkdir gccbuild – % cd gccbuild ? 配置環(huán)境: – % ../threads=posix disablechecking enablelonglong host=i386redhatlinux withsystemzlib enablelanguages=c,c++,java – 將 GCC安裝在 /usr/local/,支持 C/C++和 JAVA語言 71 ? 編譯安裝: – % makeamp。amp。make install ? 其它配置: – GCC ,包括命令文件(如 gcc、 g++)、庫文件等都在 ${destdir}目錄下分別存放,如命令文件放在 bin目錄下、庫文件在 lib下、頭文件在 include下等。由于命令文件和庫文件所在的目錄還沒有包含在相應的搜索路徑內,所以必須要作適當?shù)脑O置之后編譯器才能順利地找到并使用它們。 – 用符號連接的方式實現(xiàn),這樣做的好處是我仍然可以使用系統(tǒng)上原來的舊版本的 GCC編譯器。 – % ln s ${destdir}/bin/gcc gcc34 – 庫路徑的設置: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{destdir}/lib – setenv LD_LIBRARY_PATH /usr/local/:$LD_LIBRARY_PATH 72 GCC的編譯環(huán)境 ?工具: – gcc c編譯器,它在鏈接時使用 c庫 – cc1 實際的 c編譯器 – cc1plus 實際的 c++編譯器 – collect2 使用 collect2產生特定的全局初始化代碼,后臺處理是傳遞參數(shù)給 ld完成實際的鏈接工作。 – 初始化和結束代碼 – libgcc 平臺相關的庫 73 ? binutils相關工具: – as: gnu匯編工具 – gprof : 性能分析工具 – ld : gnu鏈接器,鏈接器可以讀寫各種目標文件中的信息,通過 BFD( binary file descriptor)提供的工具實現(xiàn), BFD定義了類似 , elf, coff等目標文件的格式 – make: – objcopy: 目標文件從二進制格式翻譯或復制到另一種 – objdump: 顯示目標文件的各種信息 – strings: 顯示文件的字符串 – strip : 去除符合表 – readelf : 分析 elf并顯示信息 74 ?gcc預定義宏 – __BASE_FILE__ 完整的源文件名路徑 – __cplusplus 測試 c++程序 – __DATE__ 日期 – __FILE__ 源文件名 – __func__ 替代 __FUNCTION__, __FUNCTION__以被 GNU不推薦使用 – __TIME__ 日期 – __LINE__ 行數(shù) – __VERSION__ gcc版本 75 ? 常用優(yōu)化選項 – gcc默認提供了 5級優(yōu)化選項的集合 : – O0:無優(yōu)化 (默認 ) – O和 O1:使用能減少目標文件大小以及執(zhí)行時間并且不會使編譯時間明顯增加的優(yōu)化 .在編譯大型程序的時候會顯著增加編譯時內存的使用 . – O2:包含 O1的優(yōu)化并增加了不需要在目標文件大小和執(zhí)行速度上進行折衷的優(yōu)化 .編譯器不執(zhí)行循環(huán)展開以及函數(shù)內聯(lián) .此選項將增加編譯時間和目標文件的執(zhí)行性能 . – Os:專門優(yōu)化目標文件大小 ,執(zhí)行所有的不增加目標文件大小的 O2優(yōu)化選項 .并且執(zhí)行專門減小目標文件大小的優(yōu)化選項 . – O3:打開所有 O2的優(yōu)化選項并且增加 finlinefunctions, funswitchloops,fpredictivemoning, fgcseafterreload and ftreevectorize優(yōu)化選項 . 76 ?GCC 的編譯錯誤類型 – C語法錯誤 ? 錯誤資訊 ∶ 文件 n行有語法錯誤 (syntex errror) –頭文件錯誤 ? 錯誤資訊 ∶ 找不到頭文件 (Can not find include file ) –檔案庫錯誤 ? 錯誤資訊 ∶ 連接程序找不到所需的函數(shù)庫 –未定義符號 ? 錯誤資訊 ∶ 有未定義的符號 (Undefined symbol)。 77 推薦讀物 ?《 GCC 中文手冊》 ?《學習使用 GCC》 ?《 Using the GNU Compiler Collection》
點擊復制文檔內容
電大資料相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1