You are not logged in.

#1 2012-05-10 19:02:18

arch_itect
Member
Registered: 2012-05-10
Posts: 2

[SOLVED] socket programming error arch x86_64 VM (inside virtualbox)

I'm getting a bunch of compile errors similar to those shown below (examples show 'close' but I also get similar errors on 'read' and 'write' function calls). The exact same code compiles on Ubuntu 64-bit/32-bit and Cygwin etc. Also, I am not getting any errors about missing header files etc.

In member function '......'
AccessMethod.cpp:145:17: error: 'close' was not declared in this scope

In constructor 'SocketAccessMethod::SAM(const char*, const char*)':
AccessMethod.cpp:NNN:MM: error: 'close' was not declared in this scope

These are the included headers:

#include "AccessMethod.h"
#include "RegSet.h"
#include "Common/Logger.h"
// local access method
#include <sys/types.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <stdexcept>
// socket access method
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <netdb.h>
#include <cerrno>
#endif

System info: Linux utopia 3.3.5-1-ARCH ..... x86_64 Intel(R) Core(TM) i5 CPU M 560 running inside Virtual Box 4.1.14.

I am sorry I cannot post the code here as I would need to check company rules but I hope somebody can help. If there is other additional info that would help (installed packages etc.), I can provide that. TIA.

Last edited by arch_itect (2012-05-12 05:49:56)

Offline

#2 2012-05-10 19:30:32

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] socket programming error arch x86_64 VM (inside virtualbox)

changes in gcc 4.7. Include unistd.h.

Offline

#3 2012-05-11 19:42:13

arch_itect
Member
Registered: 2012-05-10
Posts: 2

Re: [SOLVED] socket programming error arch x86_64 VM (inside virtualbox)

That solved it. Thanks!

Offline

#4 2012-05-11 20:54:59

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] socket programming error arch x86_64 VM (inside virtualbox)


Burninate!

Offline

Board footer

Powered by FluxBB