尝试 运行 C++ 代码,出现 "Procedure Entry Point" 错误
Trying To Run C++ Code, A "Procedure Entry Point" Error Occurred
我一直在尝试运行这段代码:
#include<iostream>
#include<vector>
using namespace std;
int main() {
vector<int> s = {0};
cout << s[0] << endl;
return 0;
}
但是出现一个错误:
我尝试 运行 它使用 cmd,写
g++ Source.cpp
编译成 a.exe
而我不能 运行 它。
我尝试使用字符串 header(开头为 #include<string>
)将 vector
替换为 string
,但收到类似的错误消息。
有什么建议吗?
编辑:ted 带来的答案对我很有帮助!
我写了
g++ -static Source.cpp
然后我 运行 代码完美无缺!
我将它添加到 atom 的编译器选项中,效果也很好!
谢谢你们!我喜欢这个社区 :)
我一直在尝试运行这段代码:
#include<iostream>
#include<vector>
using namespace std;
int main() {
vector<int> s = {0};
cout << s[0] << endl;
return 0;
}
但是出现一个错误:
我尝试 运行 它使用 cmd,写
g++ Source.cpp
编译成 a.exe
而我不能 运行 它。
我尝试使用字符串 header(开头为 #include<string>
)将 vector
替换为 string
,但收到类似的错误消息。
有什么建议吗?
编辑:ted 带来的答案对我很有帮助! 我写了
g++ -static Source.cpp
然后我 运行 代码完美无缺!
我将它添加到 atom 的编译器选项中,效果也很好! 谢谢你们!我喜欢这个社区 :)