I have a simple c++ Visual Studio project:
#include "test.h"
test::test()
{
}
test::~test()
{
}
HEADER:
#pragma once
#include <string>
class test
{
public:
test();
~test();
};
When I compile test.cpp I get many errors in the vc/include files relating to extern c as given below. They only appear when I add the line:
#include <string>
I tried this test because another project suddenly stopped working.
I tried repairing Visual Studio, but it did not help.
Severity Code Description Project File Line Suppression State Error (active) this declaration may not have extern 'C' linkage testextern c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception 369
Severity Code Description Project File Line Suppression State Error (active) more than one instance of overloaded function "std::operator==" has 'C' linkage testextern c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception 334
Severity Code Description Project File Line Suppression State Error C2894 templates cannot be declared to have 'C' linkage testextern c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common 194