如题,我不太清楚,这些选项怎么设置,各自有什么作用。谁能详细的给讲讲?如果内容太多,推荐相应的书籍也可以。比如:
1.preprocessor definitions是做什么用的?怎么设置?举例...
2.debug info 中各选项的含义。
3.project option中是做什么用的,怎么设置?举例(比如加入:/I..\..\.. /D TSOC_HAS_DLL=1 /D "TSOC_BUILD_DLL" ,是什么意思,做什么用的?)
4.link中那些多选框的内容。上面只是一些列举,我的意思就是setting里的这些相关设置的含义?更甚至于vc中各菜单项的使用的用法。请各位指教。谢谢
1.preprocessor definitions是做什么用的?怎么设置?举例...
2.debug info 中各选项的含义。
3.project option中是做什么用的,怎么设置?举例(比如加入:/I..\..\.. /D TSOC_HAS_DLL=1 /D "TSOC_BUILD_DLL" ,是什么意思,做什么用的?)
4.link中那些多选框的内容。上面只是一些列举,我的意思就是setting里的这些相关设置的含义?更甚至于vc中各菜单项的使用的用法。请各位指教。谢谢
1 要有些英语基础
2 要对编程的一些概念了解建议:
1 学点英语
2 看点语法书
3 找本VC入门书,有的讲解了设置
4 用VC 2003以上版本的简体中文版,其MSDN中有关于各项目详细的解释。当然VC 6的MSDN中也有,英文的。
/O2 maximize speed /Os favor code space
/Oa assume no aliasing /Ot favor code speed
/Ob<n> inline expansion (default n=0) /Ow assume cross-function aliasing
/Od disable optimizations (default) /Ox maximum opts. (/Ogityb1 /Gs)
/Og enable global optimization /Oy[-] enable frame pointer omission
/Oi enable intrinsic functions -CODE GENERATION-/G3 optimize for 80386 /Gy separate functions for linker
/G4 optimize for 80486 /Ge force stack checking for all funcs
/G5 optimize for Pentium /Gs[num] disable stack checking calls
/G6 optimize for Pentium Pro /Gh enable hook function call
/GB optimize for blended model (default) /GR[-] enable C++ RTTI
/Gd __cdecl calling convention /GX[-] enable C++ EH (same as /EHsc)
/Gr __fastcall calling convention /Gi[-] enable incremental compilation
/Gz __stdcall calling convention /Gm[-] enable minimal rebuild
/GA optimize for Windows Application /EHs enable synchronous C++ EH
/GD optimize for Windows DLL /EHa enable asynchronous C++ EH
/Gf enable string pooling /EHc extern "C" defaults to nothrow
/GF enable read-only string pooling /QIfdiv[-] enable Pentium FDIV fix
/GZ enable runtime debug checks /QI0f[-] enable Pentium 0x0f fix -OUTPUT FILES-/Fa[file] name assembly listing file /Fo<file> name object file
/FA[sc] configure assembly listing /Fp<file> name precompiled header file
/Fd[file] name .PDB file /Fr[file] name source browser file
/Fe<file> name executable file /FR[file] name extended .SBR file
/Fm[file] name map file -PREPROCESSOR-/C don't strip comments /FI<file> name forced include file
/D<name>{=|#}<text> define macro /U<name> remove predefined macro
/E preprocess to stdout /u remove all predefined macros
/EP preprocess to stdout, no #line /I<dir> add to include search path
/P preprocess to file /X ignore "standard places" -LANGUAGE-/Zi enable debugging information /Zl 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} disable/enable vtordisp
/Zp[n] pack structs on n-byte boundary /vm<x> type of pointers to members
/Za disable extensions (implies /Op) /noBool disable "bool" keyword
/Ze enable extensions (default) -MISCELLANEOUS-/?, /help print this help message /V<string> set version string
/c compile only, no link /w disable all warnings
/H<num> max external name length /W<n> set warning level (default n=1)
/J default char type is unsigned /WX treat warnings as errors
/nologo suppress copyright message /Yc[file] create .PCH file
/Tc<source file> compile file as .c /Yd put debug info in every .OBJ
/Tp<source file> compile file as .cpp /Yu[file] use .PCH file
/TC compile all files as .c /YX[file] automatic .PCH
/TP compile all files as .cpp /Zm<n> max memory alloc (% of default) -LINKING-/MD link with MSVCRT.LIB /MDd link with MSVCRTD.LIB debug lib
/ML link with LIBC.LIB /MLd link with LIBCD.LIB debug lib
/MT link with LIBCMT.LIB /MTd link with LIBCMTD.LIB debug lib
/LD Create .DLL /F<num> set stack size
/LDd Create .DLL debug libary /link [linker options and libraries]其中
/D 后面跟的是编译时候的宏, 如果在 settings->c/c++ 中的 preprocessor definitions 中定义 WIN32,NDEBUG 到编译的时候就会转换为
cl /D "WIN32" /D "NDEBUG"
象预编译头文件是参数
/Fp
你可以在settings->c/c++ 中的project options 中看到一堆参数,这些都是要传递给cl.exe 的
象下面这样/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /Fp"ReleaseUnicode/window_worklib.pch" /YX /Fo"ReleaseUnicode/" /Fd"ReleaseUnicode/" /FD /c 其实最后的运行命令就是这样的.
cl.exe /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /Fp"ReleaseUnicode/window_worklib.pch" /YX /Fo"ReleaseUnicode/" /Fd"ReleaseUnicode/" /FD /c +需要编译的c++文件名
link,和rc 也是一样的.