ubuntu - Debian - 未找到 g++-mingw-w64

标签 ubuntu debian mingw-w64

我正在尝试在基于 Linux Debian 和 上编译 Windows cpp 程序我安装了wingw-w64 但在控制台上看不到它。我该如何解决这个问题?
当我尝试这个时,我得到:

└─$ g++-mingw-w64                     
g++-mingw-w64: command not found
我怎么解决这个问题?
mingw-w32 效果很好。
谢谢!

最佳答案

这看起来不像正确的文件名。
正确的文件名将以三元组 <arch>-w64-mingw32 开头在哪里 <arch>是处理器架构:i686对于 x86,x86_64对于 x64(对于 ARM 上的 Windows,甚至可能是 aarch64)。
利用:

  • Windows 32 位
  • i686-w64-mingw32-gcc (三)
  • i686-w64-mingw32-g++ (C++)

  • Windows 64 位
  • x86_64-w64-mingw32-gcc (三)
  • x86_64-w64-mingw32-g++ (C++)


  • 小费:
    要检查生成的输出 (.exe/.dll) 在哪个平台上运行,请使用 file命令。例如:
    echo "int main () { return 0; }" | x86_64-w64-mingw32-gcc -xc - -o test.exe
    file test.exe
    
    返回:
    test.exe: PE32+ executable (console) x86-64, for MS Windows
    
    

    关于ubuntu - Debian - 未找到 g++-mingw-w64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72508108/

    相关文章:

    ubuntu - lsblk -f 将我的硬盘文件系统检测为 vfat 而不是 fat32

    带有 Composer 的phpunit无法正常工作

    ubuntu - fiji imagej 在 Ubuntu 16.04 上崩溃

    linux - 使用 grep 搜索包含一些文本的文件

    php - 在 Debian 10 Buster 中安装 php-db 时出错

    windows - Windows下用MinGW-w64编译POCO库(找不到消息编译器)

    php - 在新服务器上部署 Symfony3 时遇到问题

    linux - 从文件添加 iptable 规则

    混帐庆典 : stuck after writing the message for commit

    c - 在 Windows 7 上获取 Valgrind