使用 make 在 cygwin 中编译的 C 程序:"cannot execute binary file"

C program compiled in cygwin with make: "cannot execute binary file"

我正在尝试 运行 某人编写的代码,该代码可以在 linux 中完美地 "make"ed 并且工作正常。 当我在 cygwin 中 "make" 和 运行 时,我得到 "cannot execute binary file" 错误。 当我 "file" 可执行文件时,它说:

$ 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)

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

中执行 Linux 版本

尝试运行kmeans.exe