1

我正在尝试编译 Visual Studio 解决方案。我相信源文件是好的。我收到了一系列编译错误。

新安装的 Visual Studio。我打开解决方案并运行构建,它有错误。我去了 Project,并注意到有许多缺失的功能。我安装了它们:-

Windows XP Support for C++
Common Tools for Visual C++ 2015
Windows 8.1 SDK and Universal CRT SDK
Microsoft Foundation Classes for C++

然后我尝试构建解决方案,但收到一个错误通知我

Error   C1083   Cannot open include file: 'vld.h': No such file or directory ...

我对此进行了研究并设法弄清楚这是指Visual Leak Detector

我安装了那个。现在我面临的错误更少,但有数百个警告。我现在不太关心的警告。但我正在努力解决错误,推动事情向前发展。

我现在得到的错误是:

首先:-

Severity    Code    Description Project File    Suppression State
Error (active)      expected an identifier    c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\string 666 
Error (active)      expected an expression    c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\string 667 
Error (active)      expected a ';'            c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\string 689 

在字符串文件(有这些错误)中,这是导致错误的代码部分:

// basic_string LITERALS
inline namespace literals {
inline namespace string_literals {
inline string operator "" s(const char *_Str, size_t _Len)
    {   // construct literal from [_Str, _Str + _Len)
    return (string(_Str, _Len));
    }

inline wstring operator "" s(const wchar_t *_Str, size_t _Len)
    {   // construct literal from [_Str, _Str + _Len)
    return (wstring(_Str, _Len));
    }

inline u16string operator "" s(const char16_t *_Str, size_t _Len)
    {   // construct literal from [_Str, _Str + _Len)
    return (u16string(_Str, _Len));
    }

inline u32string operator "" s(const char32_t *_Str, size_t _Len)
    {   // construct literal from [_Str, _Str + _Len)
    return (u32string(_Str, _Len));
    }
}   // inline namespace string_literals
}   // inline namespace literals
_STD_END

根据编译器,上面的以下 3 行是错误的:-

inline namespace literals {                    [line 666]
inline namespace string_literals {             [line 667]
_STD_END                                       [line 689]

然而,这是一个 Microsoft 包含,直接来自 C++ 的基础类,所以我不明白它为什么会产生这个错误。

第二

我收到此错误。

Error   LNK1181 cannot open input file 'C:\Git\projectpath\Release\aspirata.lib'    SymbolDumperUserDll C:\Git\projectpath\SymbolDumperUserDll\LINK 1   

为简单起见,我已将路径名称缩短为“项目路径”。

现在我已经安装了我上面提到的三个组件和 VLD,我自己的想法已经用完了。

最后一个错误是引用发布目录中的 .lib ,所以我认为这可能与编译早期没有创建 .lib 文件有关,可能是由于上面的第一个错误?但我不太确定。

你能建议我如何克服这些编译错误吗?

  • 谢谢
4

0 回答 0