其中,VS 2012 中 Visual C++ 项目中对静态库的引用
Where is the reference to static library in the Visual C++ project in VS 2012?
>我应该在同一解决方案中的 2 个项目中引用相同的静态库。 虽然链接一个项目有此引用,但另一个项目没有。所以我在第二个项目中遇到链接错误。但是,我只能在.vcxproj文件中看到差异:
一个有这样一行:
<AdditionalOptions>/ERRORREPORT:PROMPT ..debugmembraneStaticLibr.lib DelayImp.lib %(AdditionalOptions)</AdditionalOptions>
另一个没有这条线。 请参阅下面的包围代码。
这种与 Visual C++ GUI 的项目属性中反映的静态库的区别在哪里?
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/ERRORREPORT:PROMPT ..debugmembraneStaticLibr.lib DelayImp.lib %(AdditionalOptions)</AdditionalOptions>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<LinkErrorReporting />
</Link>
">
其他选项"字段可以在"项目属性"->"配置属性"->"链接器->命令行"中找到。但是,不能在其中指定依赖项。使用链接器中的"其他依赖项"字段,甚至更好地使用">通用属性"中的项目引用。
相关文章:
- 处理类内的回调时,必须调用对非静态成员函数的引用
- 类 Referention 中C++回调函数引用非静态函数
- Qt 静态库未定义引用
- 非静态成员引用必须相对于特定对象
- 静态库单独使用很好,但在引用时会抛出错误
- 对静态分配的子类对象进行静态分配的纯虚拟父类引用是否合法?
- CMake 不链接 C 和 C++ 静态库(未定义对函数的引用)
- 如何初始化对类内变量的静态引用,以便在嵌套类中使用
- 如何在C++的静态方法中访问非静态引用
- 错误:非静态引用成员"std::ostream&Student::out",无法使用默认赋值运算符
- 错误:非静态引用成员,无法使用默认赋值运算符
- C++ 如何释放对外部对象的静态引用
- 如何初始化对 std::ofstream 的静态引用
- 内联变量仿真:我可以使用全局静态引用来强制函数中静态变量的初始化顺序吗?
- 静态引用引用临时变量
- c++中的静态引用
- C++静态成员函数作为C回调函数需要访问非静态引用
- 基类静态引用数据成员上的C++对象切片行为的奇怪案例
- 单例或将指针传递给管理器中的静态引用
- "非静态引用成员,不能使用默认赋值运算符"