MSVC链接器link参数总结
/DEBUG (Generate debug info)
/DEBUG[:{FASTLINK|FULL|NONE}]
The /DEBUG linker option creates a debugging information file for the executable.
/DEBUG 用于创建可执行文件的 调试信息文件。
The /DEBUG option puts the debugging information from linked object and library files into a program database (PDB) file. It updates the PDB during subsequent builds of the program.
An executable (an EXE or DLL file) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set the /PDB option and specify a different file name.
/LIBPATH (Additional Libpath)
/LIBPATH:dir
Specifies a path that the linker searches before it searches the path specified in the LIB environment option.
在搜索LIB环境变量的路径前, 先在/LIBPATH参数指定的路径里搜索 库文件。
lib文件 需要在linker里手动指定,或者是预处理指令#pragma comment(lib, "user32.lib") 添加。
/OUT (Output File Name)
/OUT:filename
设置 输出的程序的文件名
By default, the linker forms the file name using the base name of the first .obj file specified and the appropriate extension (.exe or .dll).
The /OUT option overrides the default name and location of the program that the linker creates.
link main.obj /OUT:MyProgram.exe

浙公网安备 33010602011771号