hlsyounes / mdpsim

PPDDL plan evalutation simulator
Apache License 2.0
14 stars 5 forks source link

Local getopt.h interfers with systems getopt.h #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Daniel Borrajo reports the following compilation failure on Mac (Darwin
Kernel Version 8.10.1):

$ make
make  all-am
if g++ -DHAVE_CONFIG_H -I. -I. -I.  -I./cudd   -g -O2 -MT mdpsim.o -MD
-MP -MF ".deps/mdpsim.Tpo" -c -o mdpsim.o mdpsim.cc; \
then mv -f ".deps/mdpsim.Tpo" ".deps/mdpsim.Po"; else rm -f
".deps/mdpsim.Tpo"; exit 1; fi
./getopt.h:147: error: declaration of C function 'int getopt()'
conflicts with
/usr/include/unistd.h:422: error: previous declaration 'int getopt(int,
char* const*, const char*)' here
make[1]: *** [mdpsim.o] Error 1
make: *** [all] Error 2

The problem is that #include <getopt.h> in mdpsim.cc picks up the local
version of getopt.h.  Fix this by moving getopt.h to a "port" directory.

Original issue reported on code.google.com by hlsyou...@gmail.com on 12 Oct 2007 at 4:36

GoogleCodeExporter commented 9 years ago
Until this is fixed, just remove getopt.h if you have the same problem.

Original comment by hlsyou...@gmail.com on 12 Oct 2007 at 4:43

GoogleCodeExporter commented 9 years ago
Fixed in revision 10.  Moved getopt.h to port directory.  This also solved 
linker
trouble on Cygwin.

Original comment by hlsyou...@gmail.com on 13 Oct 2007 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by hlsyou...@gmail.com on 15 Oct 2007 at 3:01