falundafa Forum Index -> 桃源神术(程序员专版)

终于解决了一个奇怪的链接问题

  Author    Thread Post new topic   Reply to topic
唐奇



Joined: 02 Feb 2006
Posts: 4791
终于解决了一个奇怪的链接问题

终于解决了一个奇怪的链接问题

一个代码库,从VC6移植到VC2005,但是在项目中用时,总是出现
msvcrt.lib与libcmt.lib的冲突,如_sprintf函数等重复出现。

排除连接msvcrt.lib或libcmt.lib都不行。

把此项目要连接的其他库与此库的编译命令行相对比,找到了差别。

属性->C/C++->预处理器,预处理器定义:WIN32;NDEBUG;_LIB

把_LIB改为_WINDOWS,重新编译后连接成功。

但是刚才一试,再改回,也可以了。

2005连接问题真是多,还都是些奇异的。

还有,这是在release版状态下,如果是在debug状态下,一直都是好好的。
[/url]

 Reply with quote  
Post Tue Jul 08, 2008 3:13 pm 
 View user's profile Send private message
唐奇



Joined: 02 Feb 2006
Posts: 4791

还有,这是以前就编译好过了的呀,怎么后来就是不行呢?

现在终于又可以了。

 Reply with quote  
Post Tue Jul 08, 2008 3:15 pm 
 View user's profile Send private message
唐奇



Joined: 02 Feb 2006
Posts: 4791

调试Release版本程序
VC6 :
Alt+F7,C++/C->General:Debug Info setting = Program Database
Link,Generate Debug Info

VC2005:
属性,C++/C->常规:调试信息格式=程序数据库
Link->调试:生成调试信息=是

 Reply with quote  
Post Tue Jul 08, 2008 3:25 pm 
 View user's profile Send private message
唐奇



Joined: 02 Feb 2006
Posts: 4791

当然,还要禁用优化才能正常调试。

 Reply with quote  
Post Tue Jul 08, 2008 3:37 pm 
 View user's profile Send private message
caicai



Joined: 24 Dec 2008
Posts: 15

ninhao

 Reply with quote  
Post Wed Jan 21, 2009 10:14 pm 
 View user's profile Send private message
  Display posts from previous:      
Post new topic   Reply to topic

Forum Jump:
 
Page 1 of 1



Last Thread | Next Thread  >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum