在C++中,您获得了头文件(.h),(.lib)文件和(.dll)文件.
在Visual Studio中,您提供了在三个不同位置搜索这些文件的位置:
配置属性=> C/C++ =>常规=>其他包含目录.在这里列出要搜索并可用的"包含"目录.
配置属性=>链接器=>常规=>其他库目录.在这里列出了要搜索并可用的"lib"目录.
配置属性=>链接器=>输入=>其他依赖项.在这里,您明确指定要包含的.lib文件.
问题是:
Q1:如果您已在#1中指定了头文件而在#2中指定了lib,那么为什么/何时需要在#3中指定任何内容?
Q2:我看到人们在#3中包含lib的特定调试版或发行版.你可以在#3中指定lib的调试版本或发行版本,还是在发布或调试模式下构建吗?理想情况下,应在此处提供哪个版本的库调试/发布?
我试图在C#中启动/停止基于Windows的集群,下面是我到目前为止使用的代码...当我到达下面的TakeOffLine函数时,我从System.Management.ManagementStatus得到一个"未找到"异常.未找到.不知道到底发现了什么?如果有(替代)更好的方法,请告诉我.
谢谢!
using System.Management;
class App
{
public static void Main()
{
string clusterName = "clusterHex"; // cluster alias
string custerGroupResource = "clusterHex.internal.com"; // Cluster group name
ConnectionOptions options = new ConnectionOptions();
options.Authentication = System.Management.AuthenticationLevel.PacketPrivacy;
// Connect with the mscluster WMI namespace on the cluster named "MyCluster"
ManagementScope s = new ManagementScope("\\\\" + clusterName +
"\\root\\mscluster", options);
ManagementPath p = new ManagementPath("Mscluster_Clustergroup.Name='" + custerGroupResource + "'");
using (ManagementObject clrg = new ManagementObject(s, p, null))
{
// Take clustergroup off line …Run Code Online (Sandbox Code Playgroud) 在C++中,大多数lib都是Debug/Release版本.问题1.调试版和发布版之间有什么大的区别(例如,使用一个版本与另一个版本有什么优势).
问题2. lib只是有一个函数的实现,如果你使用调试/发布版本,函数实现如何改变?
问题3.您是否可以在调试模式下构建应用程序并使用lib的发行版本?
谢谢.