C++代码,运行环境VS2019,先贴代码
#include <iostream>
#include <string>
using namespace std;
int main() {
string str = "AlexChing";
cout << str << endl;
return 0;
}
其中会报错:
LINK : fatal error LNK1104: 无法打开文件“…\Debug\test.exe”
这里的解决方案是将x86改为x64,改完之后执行程序无报错。可能的原因与string有关,但不知道原理,如果有知道的可以相互交流~
出错的其他可能的解决方案:Debug改为Release、任务管理器中进程删除。