所以我尝试在Github Actions环境中运行这些命令:
sudo update-alternatives --config x86_64-w64-mingw32-gcc
sudo update-alternatives --config x86_64-w64-mingw32-g++
将线程模型更改为POSIX,但它会显示以下提示:
There are 2 choices for the alternative x86_64-w64-mingw32-gcc (providing /usr/bin/x86_64-w64-mingw32-gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 auto mode
1 /usr/bin/x86_64-w64-mingw32-gcc-posix 30 manual mode
2 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 manual mode
在不访问shell的情况下如何回答这个问题?我试着给出1作为命令(不起作用),并且这些:
echo "1" > sudo update-alternatives --config x86_64-w64-mingw32-gcc
echo "1" > sudo update-alternatives --config x86_64-w64-mingw32-g++
但是在我使用sudo update-alternatives --config x86_64-w64-mingw32-gcc
和sudo update-alternatives --config x86_64-w64-mingw32-g++
检查之后,提示仍然显示选择为0。(如果您手动更改备选方案,它应该记住您的选择)
我做什么好?任何帮助都是非常感谢的。
发布于 2021-05-26 23:01:52
如果您可以更改编译器优先级的值,您可以简单地将30更改为90(或任何其他大于60的值),因此/usr/bin/x86_64-w64-mingw32-gcc-posix
将成为您的自动编译器。如果此方法适合您,请执行以下操作
sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-win32 60
sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix 90
sudo update-alternatives --config x86_64-w64-mingw32-gcc
https://stackoverflow.com/questions/67707313
复制相似问题