0

我刚开始使用 Visual Studio C++ 2008 Express 用 C++ 编写一个小型应用程序。我使用 Windows 安装程序安装了 Boost Library。编译程序时出现以下错误:

正在编译...
stdafx.cpp正在
编译...
websave.cpp
GoogleAuthenticate.cpp 正在
生成代码...
将清单编译到资源...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
版权所有 (C) Microsoft Corporation。版权所有。
链接...
链接:致命错误 LNK1104:无法打开文件“libboost_system-vc90-mt-gd-1_38.lib”

// GoogleAuthenticate.h

#pragma once
#include <boost/asio.hpp>

class GoogleAuthenticate
{
  public:
        GoogleAuthenticate(void);
        virtual ~GoogleAuthenticate(void);
};

// GoogleAuthenticate.cpp

#include "StdAfx.h"
#include "GoogleAuthenticate.h"


GoogleAuthenticate::GoogleAuthenticate(void)
{
}

GoogleAuthenticate::~GoogleAuthenticate(void)
{
}

// websave.cpp

#include "stdafx.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{ 
    cout << "hello" << endl; 
return 0;
}

我检查了 boost/boost-1.38/lib 文件夹,并且 libboost_system-vc90-mt-gd-1_38.lib 在那里。还在项目的配置属性中的“其他包含目录”中添加了路径。

这里有什么遗漏的吗?

4

3 回答 3

1

您还可以将其添加到该特定项目的库目录中。右键单击项目,属性 -> 链接器 -> 常规 -> 附加库目录。

We do this because we can have different versions of boost with different projects in our configuration management structure. If you just want to use whatever version is installed on your PC, use the setting from the tools menu: Tools -> Options -> Projects and Solutions -> VC++ Directories -> Library Files.

于 2009-04-07T11:41:53.180 回答
0

您还需要将该目录添加到库目录列表中。

Tools | Options | Projects | VC++ Directories
于 2009-04-01T06:27:12.443 回答
0

忘记添加了:在 Configuration Properties > Linker > Additional Library Directories 中,输入 Boost 二进制文件的路径,例如 C:\Program Files\boost\boost_1_38_0\lib。

应该有 RTFM。http://www.boost.org/doc/libs/1_36_0/more/getting_started/windows.html#link-from-within-the-visual-studio-ide

固定的。

于 2009-04-01T14:27:38.610 回答