Chinaunix首页 | 论坛 | 博客
  • 博客访问: 654432
  • 博文数量: 111
  • 博客积分: 5010
  • 博客等级: 大校
  • 技术积分: 1461
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-08 14:40
文章分类

全部博文(111)

文章存档

2010年(10)

2009年(70)

2008年(31)

我的朋友

分类: C/C++

2009-11-11 17:06:36

1、转换VS6.0

学习 ATL,看到 ,测试了一下,发现 VC6 编译通过,VC8 在 COM_INTERFACE_ENTRY(IContextMenu) 处提示错误:no GUID has been associated with this object

  其实上面 URL 的文章,已经给出解决方案了,就是升级 Platform SDK,并把 $(VCInstallDir)PlatformSDK\include 放在 Include 目录第一位,或者不放第一也至少要在 ($VCInstallDir)include 前面!

  我自己发现的一个办法是,加一句定义:

struct __declspec(uuid("000214E4-0000-0000-C000-000000000046")) IContextMenu;

  还有第三个解决办法:不要用 COM_INTERFACE_ENTRY(IContextMenu),换成 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu),同时要 #include 

  当然第一种方法是最好的,在写 WTL 程序时也要求这样做,不过要是暂时没条件升级 Platform SDK,倒是可以先用用另外两个办法。

 

2. vs2008->vs2005

VS2008 .sln .vcproj 转VS2005

编译个WowModelViewer就不用装VS2008了。这样子啊!以前我咋就没想到呢?

.sln

Microsoft Visual Studio Solution File
, Format Version 10.00
# Visual Studio 
2008

修改为

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 
2005

.vcproj

<<>="Visual C++" Version="9.00" Name="wowmodelview" ProjectGUID="{DCA0C667-2A7A-4FCE-AD02-466F7A380E0C}" RootNamespace="wowmodelview"<>="Win32Proj"<>="131072<>开头的这句把9.00改为8.00就可以了。


3.建议vc项目用vs2005

4.1.无法打开,can not open files即无法找到该文件,归因于包含目录设置需要修改。

以VS2005为例:

需要修改以下三个包含目录:

i、c++编译器-》常规-》附加包含目录。

ii、link链接器-》附加包含目录。

iii、资源-》附加包含目录。

修改办法如下:

1.注意路径设置是否有误。

2.尽量将相对路径改为绝对路径。

 

6.生产lib文件

The first step is create an import library. Start a MSVS Command Prompt, and go to the GnuTLS installation directory.

< def:libgnutls-26.def FilesGnuTLSbin>lib>

This will create a libgnutls-26.lib that can be used as a import library for Visual Studio projects.

Build a sample program to test it as follows:

< C:Program 1.6.0 foo FilesGnuTLSbin>foo ... libgnutls-26.lib -Dssize_t="long" include -I.. foo.c FilesGnuTLSbin>cl>

These steps are not fully polished yet, but appear to work.

阅读(494) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~