Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello community!! I read about how object toolkit c++ works and I have a query related to it. If I am not wrong visual studio is used as IDE/compiler to write, compile and run object toolkit c++ application code and link with object toolkit c++ libraries. Or is there an IDE/compiler of creo object toolkit c++ to compile and run the programs of object toolkit? I am confused regarding the role of otk_install_app, creotk.dat file and otk_install.sln directory which specifies visual studio solution. Awaiting your replies and suggestions...
Regards,
Rohan
Solved! Go to Solution.
Hi,
Yep, you are correct! Visual Studio is the compiler/IDE of choice for OTK Toolkit.
To answer your questions:
Another thing to note, is that you'll need the correct VERSION of Visual Studio.
You can still USE a newer version of Visual Studio (such as VS 2017), however the "Platform Toolset" used to compile against the PTC libraries in the project will need to be per the appropriate version of Creo.
Hope this helps!
Thanks,
James Sullivan
Hi,
Yep, you are correct! Visual Studio is the compiler/IDE of choice for OTK Toolkit.
To answer your questions:
Another thing to note, is that you'll need the correct VERSION of Visual Studio.
You can still USE a newer version of Visual Studio (such as VS 2017), however the "Platform Toolset" used to compile against the PTC libraries in the project will need to be per the appropriate version of Creo.
Hope this helps!
Thanks,
James Sullivan
Hi Mr. Sullivan,
You`ve mentioned using the correct "Platform Toolset", but what is it exactly?
My team is having similar issues, and the knowledge would we much appreciated.
Thanks in advance!
@sully7 wrote:
Hi,
Yep, you are correct! Visual Studio is the compiler/IDE of choice for OTK Toolkit.
To answer your questions:
- otk_install_app
- This is an example application provided by PTC, it has a few example applications, and if I remember correctly, I believe it has the source code to match as well. It's a great resource for learning!
- creotk.dat
- The ".dat" file is the way to get Creo Parametric to load your toolkit applications. You can The name of the .dat file does not matter at all (for instance, we call ours, "cadactive.dat")
- The "manual" way to load the Toolkit application is through the "Aux Applications" button in the ribbon of Creo P
- The "automatic" way to load the Toolkit application (where the app is loaded when Creo loads) is to configure a config.pro setting for "creotkdat" (or "protkdat") to point to the ".dat" file that you have created.
- The file only contains a few required lines - which point to the binary (the DLL or EXE) as well as the "TXT Directory" (which is used for any resources required for your toolkit application, such as images, icons, GUI resource files, etc)
- otk_install.sln
- This is an example visual studio solution created by PTC. If I remember correctly, you should only really need to set a windows Environment Variable in order to get the solution to recognize the C++ libraries and Header Files.
- Otherwise, to start a new Visual Studio project from scratch, you can set the project properties (or create Visual Studio Property Sheets) to point to the required folders and settings.
Another thing to note, is that you'll need the correct VERSION of Visual Studio.
- Creo 2 = Visual Studio 2010
- Creo 3 = Visual Studio 2012
- Creo 4 & 5 = Visual Studio 2015
You can still USE a newer version of Visual Studio (such as VS 2017), however the "Platform Toolset" used to compile against the PTC libraries in the project will need to be per the appropriate version of Creo.
Hope this helps!
Thanks,
James Sullivan
Hello all,
The following articles may clear a confusion about platform toolsets, compilers and linkers, at least somewhat...
https://devblogs.microsoft.com/cppblog/use-any-c-compiler-with-visual-studio/
https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/platform-toolset
The bottom line is : as long as Creo's version appropriate MSVC (microsoft visual C++ compiler) and MSBuild version would be used, the correct byte code for Creo would be produced.
In today's development environment we have some options to choose when it comes to IDE's.
My personal preference for Creo 4 is 'Visual Studio Code' with C++ extension and vs2015 toolsets for compiler and linker. Having VS remote debugger 2015 also helps.
HIH.
FV.
Hi @sully7 ,
Can i compile Creo 2.0 protoolkit application using Visual studio 2015?
Thanks in advance.
Regards,
Harsh
hey James,
When you install Visual Studio 2015 is there any special settings that you need to set for Creo 4.0?
When compiling protoolkit Creo 3.0 using Visual Studio 2012 everything worked like "sliced bread".
Now trying to compile the same code for Creo 4.0 using Visual Studio 2015 it fails.
You mention this "Platform toolset"?
How do I know if I have that installed?
Are there different versions of that?
thanks,
Brad Bigelow
Herman Miller