On 07/04/2013 at 14:56, xxxxxxxx wrote:
I feel your pain.
It wasn't that long ago that I launched V.S. for the very first time. And I had a very hard time figuring out how to get everything set up too. Even with Steve's site as a guide.
This is my own version of the information found on Steve's site.
It's written in a different way that makes more sense to my brain. Maybe it will help you out too:
Instructions:
-Create your plugin with the skeleton folder structure inside of it
*** Make sure you have your main.cpp file set up. And in the source folder ***
*** The main.cpp file is used to load the api .h files. As well as register your plugins***
-Put your plugin folder with the basic file structure in the C4D plugins folder
-Create a new emtpy C++ project(uncheck make directory. And select the C4D plugins folder(not your new plugin folder) as the source)
-Name your project the same name as your new plugin folder so it will write the solution into that folder properly
-Add the Debug & Release property sheets to the project(view->otherwindows->propertymanager) by right clicking them and choose: CINEMA 4D R12\resource\_api_lib\
Then adding these files to the proper project folders:
Debug | Win 32 = DebugWin32.props
Debug | Win 32 = ReleaseWin32.props
-For C4D R13 and later: Go into the cinema4dsdk folder which is found in the "plugins" folder.
Then add the "projectsettings.props" file just like you added the DebugWin32.props & ReleaseWin32.props files.
NOTE: MAXON suggests a different way to do this using macros instead.
-Now right click the source folder and choose Add Existing Project
Add your main.cpp file as well as any other .cpp or .h files files you might also have in your project
VisualStudio will automatically load all of the .h files from the api into your solution
In configuration properties General
-Set Target Extension to .cdl
-Set Configuration type to Dynamic Library.dll
In configuration properties Debugging
-Set Command to: C:\Program Files\MAXON\CINEMA 4D R12\CINEMA 4D.exe or whichever .exe version you'll launch with the debugger
In configuration properties Linker
-In General->Set Output File to the same name as your project and with the extension: .cdl
-In General->Set Additional Library Directories to: C:\Program Files\MAXON\CINEMA 4D R12\resource\_api_lib
-In Input-> Additional Dependencies. Add this to the list: _api_Win32_Debug.lib
-in Advanced-> change Randomized Base Address to Disable Image Randomization (DYNAMICBASE:NO)
DONE with 32 bit setup!!
To set up 64 bit compiling we have more work to do:
-From the top menu. Click the solution platforms dropdown and select Configuration Manager
-On the right drop down list. Select "New" from the options.Then select x64
-Next be sure to also enable the BUild option for this new platform
-Add the Debug & Release property sheets to the project just like you did with the 32 bit platform setup above
-This time select these files from the _api_lib folder:
Debug | Win 64 = DebugWin64.props
Debug | Win 64 = ReleaseWin64.props
Right click on the project in the solution window and select properties
Set up the various options the same way you set up the 32 bit options with two exceptions:
-In Linker->General: Set Output File to the same name as your project and with the extension: .cdl64
-In Linker Input->Additional Dependencies. Add this to the list: _api_x64_Debug.lib
DONE with 32&64 bit setups!!
#################### This is not needed...But if you want to add the api here's how to do it#################################
#############################################################################################################################
-Right click the soultion and choose Add Existing Project: C:\Program Files\MAXON\CINEMA 4D R12\resource\_api_lib\_api.vcxproj
-Right click the soultion and choose Project Dependancies then select your plugin from the drop down list
-Make your plugin dependant on the api by enabling the checkmark
-Add the existing source files to the source folder if you have them(main, etc.)
#############################################################################################################################
-ScottA