Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

Compile error - getpid was not declared in this scope

Compile error - getpid was not declared in this scope
Charles Bradshaw 2012/09/27 17:30
I'm trying to do a source install of OpenCASCADE653.tar.gz, configure succeeds copy of config.log attached.

I have the following compile error from make make -j8 install

../../../ros/src/OSD/OSD_MemInfo.cxx: In member function 'void OSD_MemInfo::Update()':
../../../ros/src/OSD/OSD_MemInfo.cxx:87:61: error: 'getpid' was not declared in this scope

How can I fix this problem?
You have to be logged in to download the attached file
Forum supervisor 2012/09/27 18:13
Dear Charles,
'getpid' declared in /usr/include/unistd.h
In RHEL the distributive package glibc-headers contains this file.
Could you check that package glibc-headers is installed.
Charles Bradshaw 2012/09/27 20:04
Hi Thanks for the quick reply.

/usr/include/unistd.h is present from glibc-devel 2.15-57.fc17 and
$ cat /usr/include/unistd.h | grep getpid
extern __pid_t getpid (void) __THROW;

Which I don't understand.

Charles Bradshaw 2012/09/27 21:54

The answer appears to be that neither OSD_MemInfo.cxx or OSD_MemInfo.hxx include unstd.h !

Where should the #include <unistd.h> statement go?
Forum supervisor 2012/10/01 12:22
Dear Charles,
Current implementation of OSD_MedInfo.cxx (development version) contains inclusion of 'unistd.h'.
See below.

#if (defined(_WIN32) || defined(__WIN32__))
#include <windows.h>
#include <winbase.h>
#include <process.h>
#include <Psapi.h>
#ifdef _MSC_VER
#pragma comment(lib, "Psapi.lib")
#elif (defined(__APPLE__))
#include <mach/task.h>
#include <mach/mach.h>
#include <unistd.h>

AlexanderPletzer 2012/10/26 21:33

I encountered the same error on Fedora 17 using      
g++ (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)

Is there any way we can access the development version? Thanks.
Forum supervisor 2012/10/29 09:48
Dear Alexander,

The development version is available via the Collaborative portal - "".
Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map