VC編譯選項(轉載)

VC編譯選項 csdnb3a [原作]

關鍵字 VC編譯選項 出處
-優化-
/O1 最小化空間 minimize space
/Op[-] 改善浮點數一致性 improve floating-pt consistency
/O2 最大化速度 maximize speed
/Os 優選代碼空間 favor code space
/Oa 假設沒有別名 assume no aliasing
/Ot 優選代碼速度 favor code speed
/Ob 內聯展開(默認 n=0) inline expansion (default n=0)
/Ow 假設交叉函數別名 assume cross-function aliasing
/Od 禁用優化(默認值) disable optimizations (default)
/Ox 最大化選項。(/Ogityb2 /Gs) maximum opts. (/Ogityb1 /Gs)
/Og 啓用全局優化 enable global optimization
/Oy[-] 啓用框架指針省略 enable frame pointer omission
/Oi 啓用內建函數 enable intrinsic functions

-代碼生成-
/G3 爲 80386 進行優化 optimize for 80386
/G4 爲 80486 進行優化 optimize for 80486
/GR[-] 啓用 C++ RTTI enable C++ RTTI
/G5 爲 Pentium 進行優化 optimize for Pentium
/G6 爲 Pentium Pro 進行優化 optimize for Pentium Pro
/GX[-] 啓用 C++ 異常處理(與 /EHsc 相同) enable C++ EH (same as /EHsc)
/EHs 啓用同步 C++ 異常處理 enable synchronous C++ EH
/GD 爲 Windows DLL 進行優化 optimize for Windows DLL
/GB 爲混合模型進行優化(默認) optimize for blended model (default)
/EHa 啓用異步 C++ 異常處理 enable asynchronous C++ EH
/Gd __cdecl 調用約定 __cdecl calling convention
/EHc extern“C”默認爲 nothrow extern "C" defaults to nothrow
/Gr __fastcall 調用約定 __fastcall calling convention
/Gi[-] 啓用增量編譯 enable incremental compilation
/Gz __stdcall 調用約定 __stdcall calling convention
/Gm[-] 啓用最小重新生成 enable minimal rebuild
/GA 爲 Windows 應用程序進行優化 optimize for Windows Application
/Gf 啓用字符串池 enable string pooling
/QIfdiv[-] 啓用 Pentium FDIV 修復 enable Pentium FDIV fix
/GF 啓用只讀字符串池 enable read-only string pooling
/QI0f[-] 啓用 Pentium 0x0f 修復 enable Pentium 0x0f fix
/Gy 分隔鏈接器函數 separate functions for linker
/GZ 啓用運行時調試檢查 enable runtime debug checks
/Gh 啓用鉤子函數調用 enable hook function call
/Ge 對所有函數強制堆棧檢查 force stack checking for all funcs
/Gs[num] 禁用堆棧檢查調用 disable stack checking calls

-輸出文件-
/Fa[file] 命名程序集列表文件 name assembly listing file
/Fo 命名對象文件 name object file
/FA[sc] 配置程序集列表 configure assembly listing
/Fp 命名預編譯頭文件 name precompiled header file
/Fd[file] 命名 .PDB 文件 name .PDB file
/Fr[file] 命名源瀏覽器文件 name source browser file
/Fe 命名可執行文件 name executable file
/FR[file] 命名擴展 .SBR 文件 name extended .SBR file
/Fm[file] 命名映射文件 name map file

-預處理器-
/FI 命名強制包含文件 name forced include file
/C 不吸取註釋 don't strip comments
/U 移除預定義宏 remove predefined macro
/D{=|#} 定義宏 define macro
/u 移除所有預定義宏 remove all predefined macros
/E 將預處理定向到標準輸出 preprocess to stdout
/I 添加到包含文件的搜索路徑 add to include search path
/EP 將預處理定向到標準輸出,不要帶行號 preprocess to stdout, no #line
/X 忽略“標準位置” ignore "standard places"
/P 預處理到文件 preprocess to file

-語言-
/Zi 啓用調試信息 enable debugging information
/Zl 忽略 .OBJ 中的默認庫名 omit default library name in .OBJ
/ZI 啓用調試信息的“編輯並繼續”功能 enable Edit and Continue debug info
/Zg 生成函數原型 generate function prototypes
/Z7 啓用舊式調試信息 enable old-style debug info
/Zs 只進行語法檢查 syntax check only
/Zd 僅要行號調試信息 line number debugging info only
/vd{0|1} 禁用/啓用 vtordisp disable/enable vtordisp
/Zp[n] 在 n 字節邊界上包裝結構 pack structs on n-byte boundary
/vm 指向成員的指針類型 type of pointers to members
/Za 禁用擴展(暗指 /Op) disable extensions (implies /Op)
/noBool 禁用“bool”關鍵字 disable "bool" keyword
/Ze 啓用擴展(默認) enable extensions (default)

- 雜項 -
/?, /help 打印此幫助消息 print this help message
/c 只編譯,不鏈接 compile only, no link
/W 設置警告等級(默認 n=1) set warning level (default n=1)
/H 最大化外部名稱長度 max external name length
/J 默認 char 類型是 unsigned default char type is unsigned
/nologo 取消顯示版權消息 suppress copyright message
/WX 將警告視爲錯誤 treat warnings as errors
/Tc 將文件編譯爲 .c compile file as .c
/Yc[file] 創建 .PCH 文件 create .PCH file
/Tp 將文件編譯爲 .cpp compile file as .cpp
/Yd 將調試信息放在每個 .OBJ 中 put debug info in every .OBJ
/TC 將所有文件編譯爲 .c compile all files as .c
/TP 將所有文件編譯爲 .cpp compile all files as .cpp
/Yu[file] 使用 .PCH 文件 use .PCH file
/V 設置版本字符串 set version string
/YX[file] 自動的 .PCH 文件 automatic .PCH
/w 禁用所有警告 disable all warnings
/Zm 最大內存分配(默認爲 %) max memory alloc (% of default)

-鏈接-
/MD 與 MSVCRT.LIB 鏈接 link with MSVCRT.LIB
/MDd 與 MSVCRTD.LIB 調試庫鏈接 link with MSVCRTD.LIB debug lib
/ML 與 LIBC.LIB 鏈接 link with LIBC.LIB
/MLd 與 LIBCD.LIB 調試庫鏈接 link with LIBCD.LIB debug lib
/MT 與 LIBCMT.LIB 鏈接 link with LIBCMT.LIB
/MTd 與 LIBCMTD.LIB 調試庫鏈接 link with LIBCMTD.LIB debug lib
/LD 創建 .DLL Create .DLL
/F 設置堆棧大小 set stack size
/LDd 創建 .DLL 調試庫 Create .DLL debug libary
/link [鏈接器選項和庫] [linker options and libraries]

發佈了37 篇原創文章 · 獲贊 4 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章