简体   繁体   中英

Trouble compiling using Cygwin

I need to use cygwin/x to run a file, I am very new to cygwin and linux. I am having trouble compiling said file. I had someone tell me it sounds like my bin directory is not in the path. 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 -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. Before compiling, rename it

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

To test

./qlens

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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