😿问题:使用VSCode运行hello.cpp程序报错collect2.exe: error: ld returned 116 exit status
#include <iostream>
using namespace std;
int main() {
cout << "hello c++" << endl;
}
😅尝试了n种方式,最终在Github上找到碰上共同难题的小伙伴,看了一圈issue,才找到了解决方案
😃解决:在添加环境变量时将关于msys的path D:\msys64\ucrt64\bin
移至上方!,在code runner插件的基础上,成功运行c++程序!
- 参考的是github用户的意见!真的太好了呜呜呜呜┭┮﹏┭┮
- 猜测是因为由于git以及小乌龟(TortoiseGit)也有mingw64的缘故,才导致c++程序无法运行。
解决方案参考:https://github.com/msys2/MSYS2-packages/issues/4617#issuecomment-2323398128
😓此方案只针对使用code runner 插件进行简单入门配置的情况,关于手动配置,至今还未成功(来自菜鸟xYan的感叹...)