/FORCE
(Force file output)
Tells the linker to create an executable even if symbols are undefined or multiply defined.
Syntax
/FORCE
[:MULTIPLE
|:UNRESOLVED
]
Remarks
The /FORCE
linker option tells the linker to create an executable image (EXE file or DLL) even if a symbol is referenced but not defined or is defined more than once.
Important
The /FORCE
option can create an executable that crashes or misbehaves at runtime if it references an undefined symbol or, when a multiply defined symbol has different definitions, if it invokes an unexpected definition in context.
The /FORCE
option can take an optional argument:
Use
/FORCE:MULTIPLE
to create an output file whether or not LINK finds more than one definition for a symbol.Use
/FORCE:UNRESOLVED
to create an output file whether or not LINK finds an undefined symbol./FORCE:UNRESOLVED
is ignored if the entry point symbol is unresolved.
/FORCE
with no arguments implies both /FORCE:MULTIPLE
and /FORCE:UNRESOLVED
.
The linker won't link incrementally when the /FORCE
option is specified.
If a module is compiled with /clr
, the linker ignores the /FORCE
option.
To set this linker option in the Visual Studio development environment
Open the project's Property Pages dialog box. For more information, see Set compiler and build properties.
Select the Configuration Properties > Linker > General property page.
Modify the Force File Output property. Choose OK or Apply to save your changes.
To set this linker option programmatically
- See AdditionalOptions.
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho