How can I resolve these C++ Compilation errors?

414 Views Asked by At

I am trying to compile a Visual Studio solution. I believe the source files are OK. I have been getting a series of compilation errors.

Visual Studio newly Installed. I opened the solution and ran the build, it had errors. I went to Project, and noticed there were a number of missing features. I installed them: -

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

Then I tried to build the solution but received an error informing me that

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

I researched this and managed to figure out this was referring to Visual Leak Detector

I installed that. Now I am faced with fewer errors but hundreds of warnings. The warnings I'm not too concerned about for now. But I am trying to resolve the errors, to move things forward.

The errors I am getting now are:

Firstly:-

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 

In the string file (which has these errors) here is the portion of code that is causing the errors:

// 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

The following 3 lines from the above are in error specifically according to the compiler: -

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

However this is a Microsoft Include, straight from the Foundations Classes for C++ so I don't understand why it's generating this error.

Secondly

I am receiving this error.

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

I've shortened the path name to 'project path' for simplicty above.

I have run out of ideas myself now having installed the three components I mentioned above, and VLD.

The final error is refererring to a .lib in the release directory, so I think this may be, something to do with a .lib file is not being created earlier in the compilation, maybe due to the first errors above? But i'm not too sure.

Can you suggest how I can overcome these compilation errors?

  • Thanks
0

There are 0 best solutions below