description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: /link (Pass Options to Linker) |
/link (Pass Options to Linker) |
03/25/2019 |
|
|
16902a94-c094-4328-841f-3ac94ca04848 |
Passes one or more linker options to the linker.
/link linker-options
linker-options
The linker option or options to be passed to the linker.
The /link option and its linker options must appear after any file names and CL options. A space is required between /link and any linker options. For more information, see MSVC linker reference.
This sample command line compiles hello.cpp and links it to the existing object file there.obj. It then passes an additional /VERSION command to the linker:
cl /W4 /EHsc hello.cpp there.obj /link /VERSION:3.14
The IDE normally sends separate commands to compile and link your code. You can set linker options in your project property pages.
-
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
-
Select the Configuration Properties > Linker folder.
-
Modify one or more properties. Choose OK to save your changes.
- This compiler option can't be changed programmatically.