【问题标题】:Unable to run C GTK program compiled in Linux with mingw cross compiler in windows无法在 Windows 中运行使用 mingw 交叉编译器在 Linux 中编译的 C GTK 程序
【发布时间】:2017-08-02 10:07:15
【问题描述】:

我在 Linux(simple gtk window program) 中制作了一个 C GTK 程序,并在 Linux mint 中使用 this 方式使用 mingw 交叉编译器对其进行了编译。现在我已将 a.exe 文件发送到我的 windows 10 计算机到执行它。但是当我在 Windows 10 中单击 a.exe 文件时,它说

the program can't start because <some files that I have listed in notepad in scrennshot> is missing from your computer.try reinstalling the program to fix this problem

我的 windows 10 上没有安装 gtk。我需要在我的 windows 10 机器上安装 gtk 吗?

【问题讨论】:

  • 要么静态链接,要么静态链接。
  • @FelixPalmen 我没明白你的意思??
  • 您必须在 windows 10 机器上安装 Gtk 运行时。它必须与您在 linux 上编译的版本相同。 Gtk 运行时是一个庞大的文件集,不仅是那些列出的文件……一旦你复制了这些文件,windows 就会抱怨更多。然后你有主题等......

标签: c linux windows gtk cross-compiling


【解决方案1】:

这可能是因为将可执行文件链接到共享库而不是静态库。与您的程序链接的共享库仅在您的 linux 上,它们在 windows 上不存在,因此不能在 windows 下运行。如果您想成功交叉编译您的程序,您可以静态编译您的程序,使其在 Windows 上可执行,但生成的 exe 非常大,或者您可以在 Windows 上搜索并安装丢失的 dll,然后重新运行您的程序并查看发生。

关于你的计算机上没有安装Gtk,当然你应该先安装它然后检查是否缺少其他库

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-18
    • 2015-03-25
    相关资源
    最近更新 更多