Charles
Charles

Reputation: 1

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?

Upvotes: 0

Views: 54

Answers (1)

matzeri
matzeri

Reputation: 8476

The lack of file extension is confusing GCC. Before compiling, rename it

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

To test

./qlens

Upvotes: 1

Related Questions