[英]What is the meaning of the /Fx option in MSVC compiler?
In the MSVC compiler, there is the option /Fx
which generates merged source files.在 MSVC 编译器中,有选项
/Fx
可生成合并的源文件。 However, on the documentation of the option, there is no information about how to inject code into my source files nor what is the purpose of doing it.但是,在该选项的文档中,没有关于如何将代码注入到我的源文件中的信息,也没有说明这样做的目的是什么。
If I take a dummy C++ project and add the /Fx
option, nothing changes, no .mrg
file is generated:如果我使用一个虚拟的 C++ 项目并添加
/Fx
选项,则不会发生任何变化,也不会生成.mrg
文件:
> cl.exe /c test.cpp /Fx
I have found no example of a usage of this option.我没有找到使用此选项的示例。 I didn't find anything about code injection either.
我也没有找到任何关于代码注入的信息。
So, how to inject code into a source file?那么,如何将代码注入到源文件中呢? What is the purpose of this feature?
此功能的目的是什么?
I found https://assets.ctfassets.net/9pcn2syx7zns/524v1rKJCe8GHLT3OE8nso/0c198e1ab4059da9cd902f120defa4b5/c__.pdf which, on page 198, explains that this is for attributes .我发现https://assets.ctfassets.net/9pcn2syx7zns/524v1rKJCe8GHLT3OE8nso/0c198e1ab4059da9cd902f120defa4b5/c__.pdf ,在第 198 页,解释说这是用于属性。 (emphasis mine)
(强调我的)
Basic Mechanics of Attributes Microsoft defines a set of C++ attributes that simplify COM programming and .NET Framework common language runtime development.
属性的基本机制 Microsoft 定义了一组 C++ 属性,可简化 COM 编程和 .NET Framework 公共语言运行时开发。 When you include attributes in your source files, the compiler works with provider DLLs to insert code or modify the code in the generated object files.
当您在源文件中包含属性时,编译器与提供程序 DLL 一起工作以在生成的目标文件中插入代码或修改代码。 These attributes aid in the creation of .idl files, interfaces, type libraries,and other COM elements.
这些属性有助于创建 .idl 文件、接口、类型库和其他 COM 元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.