Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2093021
  • 博文数量: 454
  • 博客积分: 10921
  • 博客等级: 上将
  • 技术积分: 5396
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-15 15:20
个人简介

伪IT男

文章分类

全部博文(454)

文章存档

2016年(2)

2013年(6)

2012年(17)

2011年(29)

2010年(24)

2009年(54)

2008年(53)

2007年(202)

2006年(67)

分类: C/C++

2006-11-27 11:04:27

在VC++的一段程序中碰到一大堆的链接错误:
LINK : warning LNK4049: locally defined symbol ""public: __thiscall std::ios_base::Init::Init(void)" ()" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall std::ios_base::Init::~Init(void)" ()" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall std::_Winit::_Winit(void)" ()" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall std::_Winit::~_Winit(void)" ()" imported
LINK : warning LNK4049: locally defined symbol ""public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(class std::basic_ostreamaits > & (__cdecl*)(class std::basic_ostream > &))" ()" imported
LINK : warning LNK4049: locally defined symbol ""class std::basic_ostream > & __cdecl std::operator<<(class std::basic_ostream > &,char const *)" (?
)" imported
LINK : warning LNK4049: locally defined symbol ""class std::basic_ostream > std::cerr" ()" imported
LINK : warning LNK4049: locally defined symbol ""class std::basic_ostream > & __cdecl std::endl(class std::basic_ostream > &)" (
)" imported
LINK : warning LNK4049: locally defined symbol "_atoi" imported
LINK : warning LNK4049: locally defined symbol "__assert" imported
CreateRtPlanDlg.obj : error LNK2001: unresolved external symbol __imp__atof
Debug/CreateRtPlan.exe : fatal error LNK1120: 1 unresolved externals
 
解决过程:
     (1)原因明显是自己使用了:atoi 和atof 这两个函数,但是搜索MSDN,自己也已经增加了 and 啊,按道理不应该有错,可还是出问题。
      (2)google上搜了一会儿,发现可能是
“maybe you're using the wrong "runtime-library". If you're compiling
QT as multithreaded, maybe you should use the "Multithreaded Run-Time
library" as well (in Visual C++ under Project->Settings->C/C++->Code
Generartion).”
      (3)于是对比了一下类似的工程,将Visual C++ under Project->Settings->C/C++->Code
Generartion 中的“Debug MultiThreaded DLL”改成了“Debug MultiThreaded” ,就一切OK!
      (4)对VC++编译环境的理解还是不够,更清楚的原因以后再去找吧。
阅读(9005) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~