Error when compiling using cygwin

I tried to compile the files in basic_dump_ex using cygwin :

/cygdrive/c/WpdPack/Examples-pcap/basic_dump_ex

$make

but I got this :

cc -g -O -mno-cygwin -I ../../include -c -o basic_dump_ex.o basic_dump_ex.c
cc: error: unrecognized command line option �-mno-cygwin�
GNUmakefile:17: recipe for target 'basic_dump_ex.o' failed
make: *** [basic_dump_ex.o] Error 1

In some articles , it is stated that deleting -mno-cygwin , solve the problem . However I cannot find it this -mno-cygwin and I do not know if it will solve the problem once deleted

I am still stuck . What should I do ?

Where did you look for "-mno-cygwin"? In the MAKEFILE?

I looked for

-mno-cygwin

inside the

WpdPack

folder as I believed it is situated there in some of the files but I could not find it . I have no idea where I can find it this -mno-cygwin . There is no MAKEFILE file inside the

WpdPack

folder .

It is a bogus compiler option. gcc -mno-cygwin will throw an error. Just remove the word from the command.

Just remove the word from the command

I did not use

-mno-cygwin

in the command . I used only

make

as command . So if I did not use

-mno-cygwin

in the command how can I remove it !!! It makes no sense .

check the content of your makefile file.

Thank you I find it :slight_smile:

In

/cygdrive/c/WpdPack/Examples-pcap/basic_dump

I found a file called

GNUmakefile

so I tried to see its content using

CAT

command and this is what I got :

$ cat GNUmakefile
# Makefile for cygwin gcc
# Nate Lawson <nate@rootlabs.com>

PCAP_PATH = ../../lib
CFLAGS = -g -O -mno-cygwin -I ../../include

OBJS = basic_dump.o
LIBS = -L ${PCAP_PATH} -lwpcap

all: ${OBJS}
        ${CC} ${CFLAGS} -o basic_dump.exe ${OBJS} ${LIBS}

clean:
        rm -f ${OBJS} basic_dump.exe

.c.o:
        ${CC} ${CFLAGS} -c -o $*.o $<



So now I see

-mno-cygwin

Then I deleted the

-mno-cygwin
sed -i 's/-mno-cygwin//g' GNUmakefile1

Then again I tried with the

 make 

command but this is what I got :

cc -g -O  -I ../../include -c -o basic_dump.o basic_dump.c
basic_dump.c: In function �main�:
basic_dump.c:27:3: warning: implicit declaration of function �exit� [-Wimplicit-function-declaration]
   exit(1);
   ^
basic_dump.c:27:3: warning: incompatible implicit declaration of built-in function �exit�
basic_dump.c:27:3: note: include �<stdlib.h>� or provide a declaration of �exit�
basic_dump.c: In function �packet_handler�:
basic_dump.c:99:3: error: �VOID� undeclared (first use in this function)
  (VOID)(param);
   ^
basic_dump.c:99:3: note: each undeclared identifier is reported only once for each function it appears in
GNUmakefile:17: recipe for target 'basic_dump.o' failed
make: *** [basic_dump.o] Error 1

Still a problem even after deleting the

-mno-cygwin

:frowning: