Compiling Final Version

On 15/04/2014 at 13:14, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   14 
Platform:    Mac  ;  
Language(s) :     C++  ;

Hi everyone, I'm been lurking around for a while, but I finally had a question I needed to ask.

I'm relatively new to C++ and Macs in general. I have a C++ project made in Xcode, and I was wondering how I go about getting it fully complied so that my code isn't exposed or anything.  I've seen CMake mentioned on here, but I only got confused looking into it.   Is that the right way to go?  Any help would be really appreciated.

Also I looked through the forums a decent amount, but I am sorry if this question has been asked before.

On 16/04/2014 at 00:53, xxxxxxxx wrote:

You need to compile and link the plugin in Xcode, you don't need cmake or anything like that. After that it will take a disassembler and a certain amount of skill to pry into your code.

If you haven't already done so, you should build the C4D example plugins. If you get a working set of plugins from that it will, among other things, assure you that everything is working. Then you can build your project.


On 16/04/2014 at 12:34, xxxxxxxx wrote:

I guess you also have to make sure that you are not compiling and linking with debug mode.

On 16/04/2014 at 16:23, xxxxxxxx wrote:

Thanks!  I'll look into it and try to do it with the examples first so there's less room for error on my part.

On 21/04/2014 at 10:47, xxxxxxxx wrote:

Hello again, I was trying to get the final build done more over the weekend, but I haven't had any luck compiling the SDK examples.  I've looked online and I haven't seen much that's any help.  Do you know about any kind of step by step online?  Thanks so much.

On 21/04/2014 at 13:53, xxxxxxxx wrote:

Without more information it's difficult to help. Have you compiled the SDK examples successfully on a PC but not on a Mac? What error do you get - is it in the compiler, linker, or something else? What system are you using - Xcode version, OSX version etc.?

The SDK examples should just build so if they don't something is probably wrong in your setup. If you tell us some more we might be able to figure out what's happening.


On 22/04/2014 at 16:21, xxxxxxxx wrote:

Hi Steve, sorry for the lack of information.

I'm currently working on a Mac OS X Lion with Xcode 4.4.1.  I haven't tried anything on PC yet, I'm going to attempt that after I can get the Mac stuff working.

My SDK examples are running no problem, but I've been having trouble building the final version.  My scheme for Archive is set to Release.   I've been trying to Archive the project and then go into the Organizer.  When I try to Validate though I get this error.

"  "cinema4dsdk" does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application."

Sorry, I'm not very familiar with Xcode.  Thanks for continuing to help me.

On 22/04/2014 at 16:25, xxxxxxxx wrote:

Since the end result is a dylib (dynamic library) and not an executable, archiving/bundling makes no sense.  Just use the cinema4dsdk.xcodeproj project that comes with Cinema 4D as is in Xcode and 'build' the plugin.  Then use that project as a template for your own plugin projects.

On 24/04/2014 at 12:43, xxxxxxxx wrote:

Hello Robert,

I'm either confused or I confused you.   I can get a working version of the SDK, all of the examples are built and load in Cinema.

I'm trying to turn them into a final version, the code locked and hidden, a version that I could send someone and they wouldn't edit it, so it wouldn't be an Xcode project at the end.

I hope that clears it up.  Thanks.

On 24/04/2014 at 12:49, xxxxxxxx wrote:

So you need only compiled "cinema4dsdk.dylib" right ?

On 24/04/2014 at 16:03, xxxxxxxx wrote:

No confusion at all.  The result of compiling/linking C++ code is machine code in binary format (period). There is no need to 'lock and hide' anything like in a scripting language.  The end result does not contain the C++ code - it is converted into binary assembler for the CPU (et al). There could be attached debug and other information (which could be accessed by a debugger or decompiler) by way of the build interface but this can be stripped by setting the appropriate project settings.

The Xcode project is just the file that specifies what is being built with references to libs and cpp and h/hpp files etcetera.  The end result, as Remotion4D point out, is a dylib.  A dylib is a dynamic library in the same format as an executable or static library (lib).  These are the final version types you will get from C++ builds.

On 24/04/2014 at 16:30, xxxxxxxx wrote:

In simpler terms.
When you give your plugin to someone else. You simply delete all of the files in your project except for these ones:
-The res folder
-The .cdl & cdl64 files
-Any other special files such as images, or documentations the user will need

I'm not a Mac user.
But I would guess it's basically done the same way as PC users.


On 05/05/2014 at 10:16, xxxxxxxx wrote:

I was busy last week with my main work so I could not check here.

Thank you all so much for sticky with me, I didn't mean to be such a dummy, messing up something so simple.