- UID
- 182352
- 积分
- 211
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-10-11
- 最后登录
- 1970-1-1
|
发表于 2006-7-28 10:29:05
|
显示全部楼层
Using VC 8 (Visual Studio 2005) to Build for AutoCAD 2000/2002/2004
Now that Microsoft has released Visual Studio 2005, many of us want to use the new IDE for building ObjectARX applications. Assuming you've already set up your projects as described above (note that you must have a working installation of Visual C/C++ 7, including all the VC 7 build tools), then you'll need to start with an updated version of my VC Build Hook utility that supports Visual Studio 2005:
Download: VCBuildHook2Setup.msi (311k)
Version 2.0.2.1 uploaded 2005-11-05 (supports VC 7.1 and VC 8*)
* The updated VC Build Hook utility supports both VC 7.1 and VC 8, so you should remove any previous version before installing version 2. In case you have problems with the new version, I am leaving the link to version 1 in the previous section. This way you can uninstall version 2 and reinstall version 1 so that you can continue using it in VC 7.1 as before.
Once the updated utility is installed, it's just a matter of updating solutions and projects to the new format by opening them in Visual Studio 2005, then making some changes in the project settings. I'm assuming that correct headers and libraries are already included in your project settings as outlined above, so that all we need to do is make sure the commands being sent to the VC 7 build tools are satisfactory. I've only tested a few projects, so this list is not necessarily complete, but I only needed to make the following changes to a freshly converted project to build it successfully.
Disable the Manifest Tool. This is easy to do, but not obvious or well documented. Right-click on a project and select 'Tool Build Order...', then select 'All Configurations' in the configuration dropdown and dismiss the warning dialog, then uncheck the box beside 'Manifest Tool'. Using the IDE, you have to do this one project at a time.
In linker settings, on the 'Manifest File' tab, set 'Generate Manifest' to 'No'. This disables manifest file generation.
Disable error reporting. In C/C++ settings, on the 'Advanced' tab, set 'Error Reporting' to 'Default'. Do the same in linker settings, on the 'Advanced' tab.
Don't use Unicode response files. Change this in C/C++ settings on the 'General' tab by setting 'Use UNICODE Response Files' to 'No'. Do the same in linker settings, also on the 'General' tab. The VC Build Hook utility will automatically convert Unicode response files to ANSI files if they are being sent to a VC 7 build tool, so this step is not strictly required, however the build will be slightly less efficient if the files need to be converted.
Disable parallel builds! The VC Build Hook utility does not work correctly if two simultaneous builds are using different settings, so you should disable this new feature in Visual Studio 2005 global options. To do this, go to Tools->Options, open 'Projects and Solutions', select the 'Build and Run' tab, and change the 'maximum number of parallel project builds' to 1. In my experience, Visual Studio is more stable when parallel builds are disabled, so there is a benefit to disabling this feature that is unrelated to VC Build Hook.
If your original project had set either of the two VC Build Hook extended solution properties to a setting other than 'Default', they need to be set again in the converted project. This is because of a change in VC 8 that causes it to no longer accept extended solution property names containing a period character. Project settings are carried forward correctly; only solution properties are affected.
If your project uses precompiled headers, there is one additional issue to deal with. Visual Studio 2005 no longer supports the "Automatically Generate" (/YX) precompiled header option. This is not a problem when using the new VC 8 build tools, but when using the VC 7 build tools, it can make the build process unbearably slow. Luckily it's not difficult to re-enable automatic use of precompiled headers when building with VC 7 build tools. To re-enable this feature in a VC 8 project that is using the VC 7 build tools, you need to edit the 'Precompiled Header' tab of the C/C++ settings. First, make sure precompiled headers are disabled ('Create/Use Precompiled Header' should be set to 'Not Using Precompiled Headers'), then set the 'Precompiled Header File' to '$(IntDir)\$(TargetName).pch' for all configurations, then go to the 'Command Line' tab and add '/YXStdAfx.h' to the 'Additional options' field at the bottom. Voila! Precompiled headers should now work just as they did when building with the Visual Studio .NET 2003 IDE.
That's all I had to do with the converted projects I've tested so far, but I need to stress again that these steps only work after you have implemented the practices I've discussed in the previous sections. If I learn of more settings that need to be changed in VS 2005, I will add them to this list. |
|