windows环境下g++无输出的解决方案

问题

powershell 复制代码
PS D:\work_console\exercises> g++ test.cpp -o test.exe 

无任何输出

重装、重新配置环境变量无任何效果

添加-v参数后信息为

powershell 复制代码
test.cpp -o test.exe -v               
Using built-in specs.               
COLLECT_GCC=C:\msys64\ucrt64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/lto-wrapper.exe    
Target: x86_64-w64-mingw32
Configured with: ../gcc-15.2.0/configure --prefix=/ucrt64 --with-local-prefix=/ucrt64/local --with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64 --with-pkgversion='Rev8, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-libstdcxx-zoneinfo=yes --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (Rev8, Built by MSYS2 project)
COLLECT_GCC_OPTIONS='-o' 'test.exe' '-v' '-shared-libgcc' '-mtune=generic' '-march=nocona'       
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/cc1plus.exe -quiet -v -iprefix C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/ -D_REENTRANT test.cpp -quiet -dumpbase test.cpp -dumpbase-ext .cpp -mtune=generic -march=nocona -version -o C:\Users\HUNTER~1\AppData\Local\Temp\cc9zq81P.s

解决方法

powershell里面弹不出来一个报错信息,cmd才可以

从cmd窗口执行c++能够看到

编译器前端组件cc1.exe/cc1plus.exe在运行时加载了错误版本的libwinpthread-1.dll动态链接库。clock_gettime64是近期在mingw-w64运行时库中新引入的API函数。

解决方法1:

直接从C:\msys64\ucrt64\bin中复制libwinpthread-1.dll到工程目录下,然后该工程就可以编译了

解决方法2:

直接从C:\msys64\ucrt64\bin中复制libwinpthread-1.dll到C:\Windows\System32中,则全局的工程都可以编译

github代理问题

OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

设置代理端口

windows打开设置,代理服务器,查看使用的端口,一般是7890或10809,然后设置端口即可

git config --global http.https://github.com.proxy http://127.0.0.1:7890

git config --global https.https://github.com.proxy https://127.0.0.1:7890

相关推荐
笨鸟先飞,勤能补拙41 分钟前
从预测到决策:人工智能与机器学习的系统方法、工程闭环与现实边界
大数据·人工智能·windows·python·机器学习·密码学
程序员-李俞1 小时前
Mistral OCR 4真正改变的不是“识字”:文档AI正在变成Agent的数据入口
人工智能·windows·ai作画·aigc·ocr·ai编程·ai写作
C++ 老炮儿的技术栈3 小时前
Qt5.9.1 Windows 完整开发环境搭建流程
开发语言·c++·windows·qt·编辑器·代码化
bkspiderx3 小时前
从零开始:VS Code搭建C/C++开发环境全指南(Windows/macOS/Linux)
c语言·c++·windows·vs code·c/c++开发环境
Rudon滨海渔村5 小时前
镜像转换esd转iso - VMware虚拟机如何安装或恢复(.esd)的Windows系统
windows·vmware·iso·esd
西安景驰电子6 小时前
《PTP精确时间协议系列》第二篇:工程部署、调试与性能优化
运维·服务器·网络·数据库·windows·性能优化
问天_观心6 小时前
零基础在windows环境下的WSL使用llamafactory(一)
人工智能·windows·python·神经网络·语言模型·github·模型蒸馏
xrkhy6 小时前
redis-shake的使用windows版本
数据库·windows·redis
我一定会有钱7 小时前
打造完美工作流:Git 配置”一次推送,三端同步”(Gitee/GitCode/GitHub)
开发语言·windows·vscode·搜索引擎·gitlab·github·visual studio code
一技安身7 小时前
【Git】零基础入门实战教程(Windows 完整版,适配竞赛仓库)
windows·git