atl 中使用标准C++函数编译不过

hardVB 2006-02-21 03:05:49
我的程序使用了标准C++的一些函数,在debug下可以compile与Linking,

但在Mini size与mini dependence compile不通过,提示为
LIBCMT.lib(fpinit.obj) : error LNK2005: __fltused already defined in StdAfx.obj
LIBCMT.lib(fpinit.obj) : warning LNK4006: __fltused already defined in StdAfx.obj; second definition ignored
Creating library ReleaseMinDependency/ShadowGraper.lib and object ReleaseMinDependency/ShadowGraper.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinDependency/ShadowGraper.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

后来我去掉了 "_ATL_MIN_CRT" 选项,
D:\LUXOOM\ShadowGraper\HumanMotion.cpp(11) : warning C4651: '/D_ATL_MIN_CRT' specified for precompiled header but not for current compile
HumanMotion.obj : error LNK2001: unresolved external symbol _cvDestroyWindow
HumanMotion.obj : error LNK2001: unresolved external symbol _cvReleaseCapture
HumanMotion.obj : error LNK2001: unresolved external symbol _cvCvtColor
HumanMotion.obj : error LNK2001: unresolved external symbol _cvLine
HumanMotion.obj : error LNK2001: unresolved external symbol _cvChangeSeqBlock
HumanMotion.obj : error LNK2001: unresolved external symbol _cvStartReadSeq
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
...全文
179 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hardVB 2006-02-21
  • 打赏
  • 举报
回复
请问这两个警告会有什么影响?
hardVB 2006-02-21
  • 打赏
  • 举报
回复
嗯,有进展,恢复_ATL_MIN_CRT再试试 结果如下

compile通过

Linking...
Creating library ReleaseMinDependency/ShadowGraper.lib and object ReleaseMinDependency/ShadowGraper.exp
LINK : warning LNK4089: all references to "cv097.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "cxcore097.dll" discarded by /OPT:REF
hardVB 2006-02-21
  • 打赏
  • 举报
回复
我的引用库是一些视频开发方面的库,是open source的,
但是因为我希望用脚本来写客户端,这样就一定要用com,写成组件。
但是这样做好像总不过,是否是方式有问题?

pomelowu 2006-02-21
  • 打赏
  • 举报
回复
恢复_ATL_MIN_CRT再试试看呢
hardVB 2006-02-21
  • 打赏
  • 举报
回复
去掉了,依然是
StdAfx.cpp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
StdAfx.exe : fatal error LNK1120: 1 unresolved externals
Error executing cl.exe.

不过只有这一个错误信息了
pomelowu 2006-02-21
  • 打赏
  • 举报
回复
打开stdafx.cpp,注释掉#include <atlimpl.cpp>这句话,然后编译,即可

http://dev.csdn.net/article/12/12676.shtm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcconlinkingtocrtinyouratlproject.asp
hardVB 2006-02-21
  • 打赏
  • 举报
回复
请问一下是否这样串连写ATL是否犯了大忌?
我的外部引用库都是标准的C++库,有没有好的方法避开这些烦人的编译问题啊

3,248

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧