【问题标题】:C program compiled in cygwin with make: "cannot execute binary file"在 cygwin 中使用 make 编译的 C 程序:“无法执行二进制文件”
【发布时间】:2015-04-03 13:43:33
【问题描述】:

我正在尝试运行一个可以在 linux 中完美“制作”的代码,并且运行良好。 当我在 cygwin 中“制作”并运行它时,我得到“无法执行二进制文件”错误。 当我“归档”可执行文件时,它会说:

$ file kmeans
kmeans: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

“for GNU/Linux 2.6.9”我不能在 Windows 中运行它吗?或者你觉得是什么问题呢?

这是一个截图:

Here are my files,,如果你想看看。

更新:我的 gcc 版本:gcc 版本 4.9.2 (GCC)

【问题讨论】:

  • 当你运行gcc -v 时,Target 的值是多少?
  • gcc 版本 4.9.2 (GCC)
  • 每次你发布控制台截图,佛陀都会杀死一只小猫。
  • @Daniel 我要的是目标,而不是编译器版本。

标签: c++ c gcc makefile cygwin


【解决方案1】:

您的程序似乎有一个kmeans(linux 二进制)和kmeans.exe Windows/cygwin 版本。
当您调用./kmeans 时,您会尝试在 Windows 中执行 Linux 版本。

尝试运行kmeans.exe

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-07
    • 2011-04-14
    • 2016-01-10
    • 1970-01-01
    • 2013-06-17
    • 1970-01-01
    • 2021-11-23
    相关资源
    最近更新 更多