I'm expieriencing difficulties to compile 'terrasync' after the latest patch. While PLIB's socket seems to be the target, the type "socket" interferes with the system headers:
g++ -g -O3 -march=opteron -DHAVE_CONFIG_H -I. -I../../src/Include -I/usr/include/subversion-1 -I/usr/include/apr-1.0 -I/opt/gnu/include -I/usr/local/include -I/opt/Boost/include/boost-1_37 -I/opt/FlightGear/include -g -O2 -I/opt/FlightGear -D_REENTRANT -c -o terrasync.o terrasync.cxx terrasync.cxx:118: error: 'netSocket socket' redeclared as different kind of symbol /usr/include/sys/socket.h:101: error: previous declaration of 'int socket(int, int, int)' terrasync.cxx: In function 'void terminate_request_handler(int)': terrasync.cxx:298: error: request for member 'close' in 'socket', which is of non-class type 'int ()(int, int, int)throw ()' [...] The following simple patch at least permits to compile - is this the way it's meant to be ? --- terrasync.cxx.original 2010-03-01 08:44:20.000000000 +0100 +++ terrasync.cxx 2010-03-01 11:35:55.975624335 +0100 @@ -115,7 +115,7 @@ deque<string> waitingTiles; typedef map<string,time_t> CompletedTiles; CompletedTiles completedTiles; -netSocket socket; +netSocket netSocket; #ifdef HAVE_SVN_CLIENT_H @@ -295,7 +295,7 @@ write(1, msg, sizeof(msg) - 1); terminating = true; signal(param, prior_signal_handlers[param]); - socket.close(); + netSsocket.close(); } @@ -517,12 +517,12 @@ // Must call this before any other net stuff netInit( &argc,argv ); - if ( ! socket.open( false ) ) { // open a UDP socket + if ( ! netSocket.open( false ) ) { // open a UDP socket printf("error opening socket\n"); return -1; } - if ( socket.bind( host, port ) == -1 ) { + if ( netSocket.bind( host, port ) == -1 ) { printf("error binding to port %d\n", port); return -1; } @@ -571,8 +571,8 @@ if (verbose && waitingTiles.empty()) { cout << "Idle; waiting for FlightGear position\n"; } - socket.setBlocking(waitingTiles.empty()); - len = socket.recv(msg, maxlen, 0); + netSocket.setBlocking(waitingTiles.empty()); + len = netSocket.recv(msg, maxlen, 0); if (len >= 0) { msg[len] = '\0'; recv_msg = true; Cheers, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -------------------------------------------------------------------------- ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel