Some Newbie questions
-
On 07/04/2013 at 15:12, xxxxxxxx wrote:
hai, sou desu!
-
On 07/04/2013 at 15:22, xxxxxxxx wrote:
Maybe the moderators can pin this thread or ScottA's description on a top-level so Newbies like me can find a quick entry to a working Compiler-setup ?
-
On 07/04/2013 at 15:30, xxxxxxxx wrote:
That's very kind.
But as they say in jolly old England: "Not Bloody Likely".This is not the "official" way they want us to set things up in VS.
So I don't think it's something they would want to promote.The blog that I linked to does a pretty good job of explaining how to do the "official" set up. With images to help see it in action.
But I must confess. I've never actually tried it that way yet.-ScottA
-
On 07/04/2013 at 15:45, xxxxxxxx wrote:
Problem:
I thought I had set it all right as ScottA described, but when I try to build a simple Hello-World code, I get this error:
1>------ Neues Erstellen gestartet: Projekt: MyCPlugin, Konfiguration: Release x64 ------
1> main.cpp
1>d:\programme\grafik\maxon\cinema 4d r14\plugins\mycplugin\source\main.cpp(34) : fatal error C1083: Cannot open include file: 'c4d.h': No such file or directory
========== Alles neu erstellen: 0 erfolgreich, Fehler bei 1, 0 übersprungen ==========
Seems that I missed setting a path, but where ?
I tried to add 'D:\Programme\Grafik\MAXON\CINEMA 4D R14\resource\_api' to the additional libraries in the Linker-> Common Tab, but always the same error message -
On 07/04/2013 at 16:09, xxxxxxxx wrote:
There's two places under Linker to set up the dependencies.
Linker- >General->Additional Library Directories:
D:\Programme\Grafik\MAXON\CINEMA 4D R14\resource\_api_libLinker- >General->Additional Dependencies:
_api_x64_Debug.lib
NOTE: for the 32 bit build version this will be:_api_Win32_Debug.libAlso make sure you have a folder in your solution called External Dependencies.
And it has the c4d.h file in it amongst the various .h files.
If that's not there you did something wrong and need to start over again.I also strongly suggest focusing on just getting a 32 bit version to compile first.
Once you can compile 32 bit version. Then you can try to set up the 64 bit version.-ScottA
-Also
There are two folders named: _api & _api_lib
The one you want to use is: _api_lib -
On 07/04/2013 at 16:27, xxxxxxxx wrote:
Oh yeah. One other thing.
Make sure C4D is closed before you try to compile your plugin.
I can't tell you how many times I got caught on that one when I first started out. !Embarrassed
[URL-REMOVED]-ScottA
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
-
On 07/04/2013 at 16:30, xxxxxxxx wrote:
Hi Scott,
no, I don't have such a folder called External Dependencies in my new Plugin-solution.
Maybe I understood something wrong.
I have added now additionally the path:
D:\Programme\Grafik\MAXON\CINEMA 4D R14\resource\_api
to the **Linker- >General->Additional Library Directories **so there is now written in that line:
D:\Programme\Grafik\MAXON\CINEMA 4D R14\resource\_api_lib;D:\Programme\Grafik\MAXON\CINEMA 4D R14\resource\_api
f.e. for the Debug Win32, I have added in the Linker- >Input->Additional Dependencies:
_api_Win32_Debug.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
I made all steps before as described by you and Microbion and added also manually a folder 'Debug' with the files DebugWin32.props and DebugWin64.props copied from the cinema4dsdk-Folder and added manually the file projectsettings.props
What could be wrong then ? -
On 07/04/2013 at 17:10, xxxxxxxx wrote:
@Scott:
OK, I started again from scratch, this time exactly how you described.
I missunderstood some phrases in your text concerning the DebugWin32.props and DebugWin64.props procedure, but I had already done the right thing according to micobions tutorial.
Anyway, now a complete new try.
This time I have the External depencies folder listed in the project.
I only made the setup so far for Debug Win32, but when trying to build I get this time:
1>------ Neues Erstellen gestartet: Projekt: mycplugin, Konfiguration: Debug Win32 ------
1> main.cpp
1>LINK : fatal error LNK1104: Datei "_api_Win32_Debug.lib" kann nicht geöffnet werden.
========== Alles neu erstellen: 0 erfolgreich, Fehler bei 1, 0 übersprungen ==========
I'll finish all steps and see what the linker says then.
Edit: Oops, wrong path to the _api_lib, I copied it from your text.
Now, with the right path, the compiler runs through and I see:
1>------ Neues Erstellen gestartet: Projekt: mycplugin, Konfiguration: Debug Win32 ------
1> main.cpp
1> Bibliothek "D:\Programme\Grafik\MAXON\CINEMA 4D R14\Plugins\mycplugin\obj\mycplugin\Win32_Debug\mycplugin.cdl.lib" und Objekt "D:\Programme\Grafik\MAXON\CINEMA 4D R14\Plugins\mycplugin\obj\mycplugin\Win32_Debug\mycplugin.cdl.exp" werden erstellt.
1> mycplugin.vcxproj -> D:\Programme\Grafik\MAXON\CINEMA 4D R14\Plugins\mycplugin\mycplugin.cdl
========== Alles neu erstellen: 1 erfolgreich, Fehler bei 0, 0 übersprungen ==========
Hip Hip, Hurah
Now, I can finish the other settings.
Thanks, Scott, your tutorial finally made it. -
On 07/04/2013 at 17:19, xxxxxxxx wrote:
It's definitely tricky. And you have to get everything just right and in the proper sequence.
It took me several tries to get it working myself.Note:
The main.cpp file works in combo with the projectsettings.props, DebugWin32.props and ReleaseWin32.props files to automatically create that folder and then loads the proper api .h files into it. So it a critical thing to get right.Make it easier on yourself.
Only try to create a 32 bit Debug version at this point. Don't even bother with setting up the 32 bit Release options at this point. You can always add those other versions later on after you get it working.Make sure you have the proper source files before you even get started.
-Do you have a main.cpp file with code in it that registers your HelloWorld plugin?
If not. Your VS setup will not automatically add the External Dependencies folder with the needed api .h files in it. And you won't be able to build the project.If all else fails and you just can't get it working. And you get frustrated and just want to move on and make a very simple plugin.
You can always make plugins right inside the compiled SDK. It's much easier than trying to build a stand alone plugin framework. A lot of people start off making their first C++ plugin this way.I have a video tutorial about that here:https://sites.google.com/site/scottayersmedia/scripting
It's aimed at Coffee users trying to switch over to C++ and VS.
It's for R12. But I think most of it is still relevant.-ScottA
-
On 07/04/2013 at 17:28, xxxxxxxx wrote:
Very nice, I'll check it out tomorrow.
Thanks again for your kind help, otherwise I think I would never have had a chance to set this beast up in the right way.