C++ Mac editor

Hi,

What IDE you would suggest to work with C++ on Mac?

I looked at Developer Tools but there is nothing on Cpp side for mac.

What editor do you usually use XCode, Visual Studio Code?

I use Visual Studio Code on both Windows and Mac most of the time. Tricky debugging sessions I may do still with Visual Studio (2019) and Xcode respectively for Rhino. But if you’re writing code from scratch I’m sure you’ll manage fine with Visual Studio Code.

Is there any templates for Rhino Mac cpp plugins?
For me mac is totally new world, including keyboard…

For Rhino Mac we don’t have a C++ SDK. As such there are no templates for that.

Does it mean that for cpp plugin creation you use windows only?

The only way i know is to create pinvoke cpp wrappers for c#.

I like Xcode and Clion (but I don’t do Rhino development).

For linking c++ libraries what would be easier xcode or vscode? Could you recommend any tutorials? I am used to visual studio, for referencing it took me a while to learn it.

No idea, never used VS (and probably never will).

It depends on what you want to link! dylib, a, or even a framework?
Usually I set up a new C++ project (command line tool), and then in the General tab of project settings, there is a category Frameworks and Libraries that you can link most files with. You might also need to adjust your build settings in some cases.

1 Like

That is correct.

RhinoCommon plug-ins are supported on Rhino Mac, so your plug-in should be in a .NET language.

You can write some code in C++, but it will have to be without using Rhino types. Anything non-Rhino specific can be in C++, then you have to P/Invoke your C++ code indeed.

For instance the core of Rhino Cycles is C++, but the actual Rhino Cycles plug-in is C# using RhinoCommon. None of the C++ code uses Rhino types.

3 Likes

Interesting! I literally know nothing about this process, but I guess somewhere in the Rhino core OpenNurbs must be used, right? Why else go through the trouble of developing and maintaining a specific C++ -based geometry framework like this.
Is there a translation layer somewhere between for instance an ON_3dPoint and Rhino.Geometry.Point3d, both being very similar structures?

1 Like

For RhinoCommon there is a set of libraries that wrap C++ functionality and provide functions we can P/Invoke. This can be done since these libraries don’t rely on any public SDK - they’re part of Rhino.

The same I do for Cycles integration, except there I wrap Cycles data types and functionality. The C wrapping code is CCycles, the .NET library is CSycles. Together they form C[CS]?ycles. This library I use in RhinoCycles to integrate Cycles into Rhino.

2 Likes

@nathanletwory , @diff-arch

Thanks for the help, it gives me more information what do I need to avoid, and what I need to learn.

As always, feel free to keep asking!

1 Like

I’m happy to help. Keep in mind that I’m a C++ n00b though. I’ve done a couple of projects related to architecture, creative coding, and extending, hot-rodding Python, but that’s it. I’ve started learning about a year ago. :wink:

1 Like