Question

I did a full installation of cygwin on a windows server 2008 r2 and I downloaded the Squid3.4.4 source. I ran the ./configure [options] command and then the next step is to Make and install squid.

When I run make I get a ton of errors. Here is a sample of what I am seeing:

$ make Making all in compat make[1]: Entering directory '/home/Administrator/squid-3.4.4/compat' /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Werror -pipe -D_REENTRANT -g -O2 -march=native -std=c++0x -MT assert.lo -MD -MP -MF .deps/assert.Tpo -c -o assert.lo assert.cc libtool: compile: g++ -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Werror -pipe -D_REENTRANT -g -O2 -march=native -std=c++0x -MT assert.lo -MD -MP -MF .deps/assert.Tpo -c assert.cc -DDLL_EXPORT -DPIC -o .libs/assert.o In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:152:0: error: "O_RDONLY" redefined [-Werror] #define O_RDONLY
_O_RDONLY ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:34:0: note: this is the location of the previous definition #define O_RDONLY 0 /* +1 == FREAD */ ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:153:0: error: "O_WRONLY" redefined [-Werror] #define O_WRONLY
_O_WRONLY ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:35:0: note: this is the location of the previous definition #define O_WRONLY 1 /* +1 == FWRITE */ ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:154:0: error: "O_RDWR" redefined [-Werror] #define O_RDWR _O_RDWR ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:36:0: note: this is the location of the previous definition #define O_RDWR 2 /* +1 == FREAD|FWRITE */ ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:155:0: error: "O_APPEND" redefined [-Werror] #define O_APPEND
_O_APPEND ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:37:0: note: this is the location of the previous definition #define O_APPEND _FAPPEND ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:157:0: error: "O_CREAT" redefined [-Werror] #define O_CREAT _O_CREAT ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:38:0: note: this is the location of the previous definition #define O_CREAT _FCREAT ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:158:0: error: "O_TRUNC" redefined [-Werror] #define O_TRUNC _O_TRUNC ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:39:0: note: this is the location of the previous definition #define O_TRUNC _FTRUNC ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:159:0: error: "O_EXCL" redefined [-Werror] #define O_EXCL _O_EXCL ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:40:0: note: this is the location of the previous definition #define O_EXCL _FEXCL ^ In file included from ../compat/compat.h:64:0, from ../include/squid.h:66, from assert.cc:32: ../compat/os/mswindows.h:161:0: error: "O_TEXT" redefined [-Werror] #define O_TEXT _O_TEXT ^ In file included from /usr/include/sys/fcntl.h:3:0, from /usr/include/fcntl.h:14, from ../compat/os/mswindows.h:48, from ../compat/compat.h:64, from ../include/squid.h:66, from assert.cc:32: /usr/include/sys/_default_fcntl.h:53:0: note: this is the location of the previous definition #define O_TEXT _FTEXT

I'm not familiar with c++. Any ideas what might be causing this?

Was it helpful?

Solution

Looks like your build is trying to define the same symbols multiple times, presumably because there is a compatibility layer trying to define them, and a "proper" defintion in another place.

I'd be tempted to find the "duplicate definition" (looks like it's in ./compat/mswindows.h) and put #ifdef O_RDONLY (the first symbol defined) around the whole thing.

I'm by no means sure that this will solve ALL your problems, but hopefully make some progress in a good direction.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top