Missing header file in OSX 10.9 for building plugin

Report crashes, strange behaviour, or apparent bugs
Post Reply
Pouya
Posts: 12
Joined: 15 Feb 2013, 11:19

Missing header file in OSX 10.9 for building plugin

Post by Pouya »

Hello. It seems on OS X Mavericks, v_repExtPluginSkeleton.cpp fails to build out box because of

Code: Select all

error: use of undeclared identifier 'getcwd'
This maybe is due to the fact that in Xcode 5, header files are no longer located in /usr but in

Code: Select all

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/v1
Solution:
It is sufficient to include <unistd.h> and rebuild.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Missing header file in OSX 10.9 for building plugin

Post by coppelia »

Thanks for mentioning this!

Cheers

Pouya
Posts: 12
Joined: 15 Feb 2013, 11:19

Re: Missing header file in OSX 10.9 for building plugin

Post by Pouya »

For future readers:

In the past few days I went through an unfair amount of pain with building plugins in Mavericks and here I share some experiences so others wont suffer.

If you are going to make platform-independent plugin, by way of using gcc, please consider few notes. First, gcc that comes with XCode 5 on mavericks, is only a front end and at the backend, it is still CLang. If you want to use gcc, you need to build it by yourself (e.g. via brew).

Secondly, until OS X 10.8 the default binaries for std library was libstdc++ but since mavericks it is changed to libc++. You need to explicitly tell to gcc to use the former or, simply use g++ instead.

I also suggest V-Rep development team to modify the Makefile and Skeleton related to c++ plugins as its current state will fail on either linux or mac.

enddl22
Posts: 5
Joined: 05 May 2015, 13:05

Re: Missing header file in OSX 10.9 for building plugin

Post by enddl22 »

It is still missing from the latest source files VREP 3.2.1 (both meshCalculationPlugin and pathPlanningPlugin).
After adding the header mentioned, everything is fine.
Cheers,

Post Reply