GNS3 / vpcs

Simple Virtual PC Simulator
BSD 2-Clause "Simplified" License
101 stars 39 forks source link

remove -I. from linux Makefile #22

Closed merlin1991 closed 4 years ago

merlin1991 commented 4 years ago

prevents duplicate getopt declaration since unistd.h includes the system getopt_posix.h but due to -I. the "local" getopt.h redeclares getopt

gcc -DLinux -Di386 -O2 -DHV -Wall -I. -DTAP -c hv.c In file included from hv.c:45: ./getopt.h:53:5: error: conflicting types for ‘getopt’ int getopt(int argc, char* argv, char optstr); ^~ In file included from /usr/include/x86_64-linux-gnu/bits/getopt_posix.h:27, from /usr/include/unistd.h:869, from hv.c:33: /usr/include/x86_64-linux-gnu/bits/getopt_core.h:91:12: note: previous declaration of ‘getopt’ was here extern int getopt (int argc, char const argv, const char *__shortopts) ^~ make: *** [Makefile.linux:37: hv.o] Error 1

grossmj commented 4 years ago

Thanks :+1: