Page 1 of 1

Missing header file in OSX 10.9 for building plugin

Posted: 25 Jun 2014, 10:17
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.

Re: Missing header file in OSX 10.9 for building plugin

Posted: 25 Jun 2014, 15:46
by coppelia
Thanks for mentioning this!

Cheers

Re: Missing header file in OSX 10.9 for building plugin

Posted: 26 Jun 2014, 09:56
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.

Re: Missing header file in OSX 10.9 for building plugin

Posted: 14 Jul 2015, 06:34
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,