简体   繁体   English

使用Cygwin进行麻烦的编译

[英]Trouble compiling using Cygwin

I need to use cygwin/x to run a file, I am very new to cygwin and linux. 我需要使用cygwin / x来运行文件,对于cygwin和linux来说我是新手。 I am having trouble compiling said file. 我在编译上述文件时遇到了麻烦。 I had someone tell me it sounds like my bin directory is not in the path. 我有人告诉我,这听起来好像我的bin目录不在路径中。 I do not know if that is true or not. 我不知道那是不是真的。 If it is could someone help me fix that. 如果可以的话,有人可以帮我解决这个问题。

$ gcc qlens

returns 退货

qlens: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

Current version of gcc 当前版本的gcc

$ gcc -v
gcc version 5.3.0 (GCC)

Type of file 档案类型

$ file qlens
qlens: Mach-O 64-bit x86_64 executable

Can someone help me compile this file and get it running? 有人可以帮助我编译该文件并使其运行吗?

The lack of file extension is confusing GCC. 缺少文件扩展名使GCC感到困惑。 Before compiling, rename it 编译之前,将其重命名

  mv qlens qlens.c
  gcc -o qlens qlens.c

To test 去测试

./qlens

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM