Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions Error when compiling using cygwin Post 302970429 by steve120 on Wednesday 6th of April 2016 12:14:04 PM
Old 04-06-2016
Thank you I find it Smilie

In
Code:
/cygdrive/c/WpdPack/Examples-pcap/basic_dump

I found a file called
Code:
GNUmakefile

so I tried to see its content using
Code:
CAT

command and this is what I got :

Code:
$ 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
Code:
-mno-cygwin

Then I deleted the
Code:
-mno-cygwin

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

Then again I tried with the
Code:
 make

command but this is what I got :

Code:
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
Code:
-mno-cygwin

Smilie

Last edited by steve120; 04-06-2016 at 01:25 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

Error Compiling C program

Hi All, I tried to compile a C program but i am getting error while Linking . it says Undefined reference to ' ' (here it gives a method name which is defined Globally ). Can any body tell the resaon and remedy for the same . Iam stuck up here . Thanks (3 Replies)
Discussion started by: Vivek
3 Replies

2. Programming

Compiling Error

Hi, I have installed "Freetype2" library in my SuSe Linux 9.3 version system. When Iam compiling a program, I am getting these below errors. Undefined reference to "FT_Init_FreeType" Undefined reference to "FT_Load_Char" Please show me a solution? Thank you. With regards, Chandramouli (1 Reply)
Discussion started by: chandra80
1 Replies

3. Programming

compilation error while using cygwin

Hello, I am trying to compile a C program from Cygwin and it gives ld: not found -user32 error .. I searched for library libuser32.so and was not able locate it.. When i create only object file using gcc -c option it gets created successfully .. When i use gcc -o option , executable is not... (4 Replies)
Discussion started by: shafi2all
4 Replies

4. Shell Programming and Scripting

Error in Cygwin

Hi, I am trying to execute a Shell script file. The file has the following commands. #Return today's log file LOG_DATE=`date +%d_%b_%Y`.log echo $LOG_DATE #Return last modified date of the Log File FILE_MOD_DATE=`date -r $LOG_DATE` echo $FILE_MOD_DATE If I execute the... (6 Replies)
Discussion started by: AnneAnne
6 Replies

5. Windows & DOS: Issues & Discussions

Problem compiling C++ Code in Cygwin

Hello everyone. I just recently installed Cygwin and I am running it under Windows 7. My problem is that I cannot seem to compile any C++ code with g++. I've tried to compile C Code using gcc and that works just fine. But Whenever I try to compile some C++ code, g++ throws a whole bunch of... (6 Replies)
Discussion started by: Anlex
6 Replies

6. Programming

gcc compiling error

I am using gcc to compile c objects on solaris 5.10 and hit the following error messages: /usr/include/sys/vfs.h:323: error: syntax error before "statvfs64_t" /usr/include/sys/vfs.h:334: error: syntax error before "statvfs64_t" gmake: *** Error 1 The c program files were copied over from... (3 Replies)
Discussion started by: med7006
3 Replies

7. Programming

Error with compiling

Hi guys. I have a header file: unp.h like this: #ifndef _UNP_H_ #define _UNP_H_ extern ssize_t readn(int filedes, void *buff, size_t nbytes); extern ssize_t writen(int filedes, const void *buff, size_t nbytes); extern void err_quit(const char *msg); #define TRUE 1 #define FALSE 0 ... (2 Replies)
Discussion started by: majid.merkava
2 Replies

8. Shell Programming and Scripting

opening new instance of cygwin from withing cygwin

I'm using cygwin on win7, What I would like to do is something like this: cygstart cygwin tail -f /foo/test.log | perl -pe 's/error/\e I know I can start a new instance using either of these: mintty -e ... cygstart tail ... But neither of those open in ANSI mode, so I can't do... (0 Replies)
Discussion started by: Validatorian
0 Replies

9. Solaris

ERROR while compiling

Hi guys i came across an error while compiling a c file in solaris using gcc. the error is, Undefined first referenced symbol in file bind /var/tmp//ccAr8qAh.o accept ... (4 Replies)
Discussion started by: rajeshb6
4 Replies

10. UNIX for Beginners Questions & Answers

Error while compiling

Hi I am trying to compile a binary file (CASPER: Context-Aware Scheme for Paired-End Read) but I am getting the following error: user@user-OptiPlex-780 make g++ -O2 -Wall -fopenmp -c -o merge.o merge.c merge.c:8:35: fatal error: boost/unordered_map.hpp: No such... (2 Replies)
Discussion started by: Xterra
2 Replies
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy