CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

Std的小问题,编译总是有错!

楼主my12121(bobo)2005-02-02 18:50:07 在 VC/MFC / 基础类 提问

老外的SDK,自带的例程中用到了std,可是编译时有几个类总是报错:  
  CyAcquisitionPage.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   __thiscall   CyChannel::CyChannel(unsigned   short,class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &)"   (__imp_  
  ??0CyChannel@@QAE@GABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  
  CyAcquisitionPage.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &   __thiscall   CyChannel::GetName(void)const   "   (__imp_?GetNa  
  me@CyChannel@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)  
  CyApp.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   __thiscall   CyXMLDocument::CyXMLDocument(class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &)"   (__imp_??0CyXMLDocument@@Q  
  AE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  
  CyDeviceDlg.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   __thiscall   CyXMLDocument::CyXMLDocument(class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &)"   (__imp_??0CyXMLDocum  
  ent@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  
  CyApp.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   unsigned   long   __thiscall   CyXMLDocument::CreateDocument(class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &)"   (__imp_?Cre  
  ateDocument@CyXMLDocument@@QAEKABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  
  CyDeviceDlg.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   const   &   __thiscall   CyAdapterID::GetIdentifier(void)const   "   (__imp_?Get  
  Identifier@CyAdapterID@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)  
  CyDeviceDlg.obj   :   error   LNK2001:   unresolved   external   symbol   "__declspec(dllimport)   public:   unsigned   long   __thiscall   CyCameraRegistry::GetName(class   std::basic_string<char,struct   std::char_traits<char>,class   std::allocator<char>   >   &)const   "   (__imp_?G  
  etName@CyCameraRegistry@@QBEKAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  
  好像每个都有std参数,大侠帮我看看是怎么回事啊?老外总是说他们那边编译没问题!郁闷死了  
  问题点数:50、回复次数:12Top

1 楼rainfall19831109(恩恩)回复于 2005-02-02 18:53:01 得分 10

看是用了DLL,你的程序里设置了LIB文件的路径没有??Top

2 楼my12121(bobo)回复于 2005-02-02 18:55:38 得分 0

设置了啊,而且我看了文件夹下面,就设置的LIB路径下面有库文件,应该没有遗漏的。  
  实在不知道问题出在哪里了Top

3 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:02:42 得分 10

using   namespace   std;Top

4 楼my12121(bobo)回复于 2005-02-02 19:03:25 得分 0

加了,呜呜Top

5 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:08:25 得分 10

是不是类的实现和定义分开了  
  Top

6 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:14:57 得分 0

把实现放到和声明放到一起  
  或者用支持分离模型的编译器  
  vc6.0是不支持的  
  去试试   2001   errorTop

7 楼my12121(bobo)回复于 2005-02-02 19:16:57 得分 0

应该不会的啊。类的说明中头文件和库文件都不缺啊。Top

8 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:18:22 得分 10

一旦实现分离了  
  必须使用支持分离模型的编译器  
  我是指STL类的话  
  注意看下一下    
  Top

9 楼my12121(bobo)回复于 2005-02-02 19:21:10 得分 0

各位大侠,我觉得是编译器设置的事情,我曾经注掉一些代码(好像是类对象声明),编译,又取消注释编译,就全部通过了。可是我现在试了很久也不知道该注掉什么了。Top

10 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:26:49 得分 0

...  
  如果是STL对象  
  是在在你调用时产生实例点  
  才会找定义[member   template   Fun也样]  
  如果你不实例  
  永远都不会报错  
  Top

11 楼goodluckyxl(被人遗忘的狗)回复于 2005-02-02 19:28:27 得分 10

你怀疑有什么用呢  
  你怀疑有用  
  你自己都解决了  
  还用提问么  
  你检查一下是否是这个问题  
  Top

12 楼my12121(bobo)回复于 2005-02-02 19:35:07 得分 0

唉,出来了居然。我不明白是为什么,我随便打开一个报错的类的头文件,注掉其中一个成员函数的return,编译,再取消注释,再编译,通过了。这是什么问题啊,怪异。。Top

相关问题

  • 〓〓〓 为何编译COM总是出错??? 〓〓〓
  • 为什么我编译总是出错?
  • !!!!编译时总是出现LNK2001错误
  • 如何编译一个UNICODE工程,我在编译头里加了_UNICODE 但编译总是报错
  • 编译错误
  • 编译错误!!
  • 编译错误??
  • 编译错误!!
  • 编译出错
  • 编译错误???

关键词

  • 编译
  • basic
  • 编译器
  • 文件
  • cyxmldocument
  • std
  • cychannel
  • thiscall
  • allocator
  • traits

得分解答快速导航

  • 帖主:my12121
  • rainfall19831109
  • goodluckyxl
  • goodluckyxl
  • goodluckyxl
  • goodluckyxl

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo