Debugging Toolkit Applications on Creo 3.0 Parametric (Error LNK2038)
For the past 5 months have been developing a Creo Parametric Toolkit application on Creo 2.0 using Visual Studio 2010. I write, test and debug my code in a Debug build. When I'm ready to deploy a sample to my testers, I create a Release build. This has been my standard practice for over 10 years.
My company plans to upgrade to Creo Parametric 3.0 M050 by the time I finish this application. For that reason, I decided to switch my development to Creo 3.0, which requires Visual Studio 2012. As is so often the case, the biggest adjustment is linking the code. My Release build seems to link just fine, but the Debug build is another story. My output window fills with LNK2038 errors like this one:
protk_dll_NU.lib(srcenv.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in ConfigFactory.obj
These errors appear for both Creo Parametric Toolkit and OTK C++. ConfigFactory is the name of one of my own C++ classes, and it actually has no dependencies on either Creo toolkit. It just happens to be the first .obj file name in the link command.
The VS2012 linker seems to require all modules to have identical RuntimeLibrary attributes, which presumably means that I need a separate protk_dll_NU.lib file for the Debug build. Unfortunately, the Pro/Tk and OTK libraries all seem to support Release builds only.
Did I make an obvious mistake here? I honestly hope so for my own sake. I need to produce both Debug builds, which I can attach a debugger to, and Release builds, which are smaller and faster than the Debug builds.
|+| M a r k |+|
