换为静态库问题

itkdqwzero 2019-01-19 07:06:20
有个自定义的DLL 在库文件为动态库时编译没问题, 库文件有很多 osg.lib osgDB.lib osgViewer.lib
这个DLL 在把库文件换成静态库, 不能编译成DLL 了, 这个项目只能编译成lib静态库.
否则成吨的"无法解析的外部符号"

更大的一个问题, 3DS_Max的插件必须是一个dle文件, 这个文件不能编译为静态库. 那么这成吨的"无法解析的外部符号"会是什么原因?
...全文
149 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Saleayas 2019-01-21
  • 打赏
  • 举报
回复
同一个依赖项,不能既有导入库,又有静态库,否则就会符号冲突了。
itkdqwzero 2019-01-21
  • 打赏
  • 举报
回复
1>------ 已启动生成: 项目: TDuExtend, 配置: Release x64 ------
1> 正在创建库 D:\ArcadiaProject\SVN\TDuEngine_Origin_2019-01-19_Build_Static\lib\osg156-TDuExtend.lib 和对象 D:\ArcadiaProject\SVN\TDuEngine_Origin_2019-01-19_Build_Static\lib\osg156-TDuExtend.exp
1>AnimationTransformWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationMaterialCallbackWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationMaterialWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationTransform.obj : warning LNK4217: 本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const ) 在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z) 中导入
1>AnimationTransformCallbackWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const ) 在函数 "public: __cdecl osg::ref_ptr<class osg::TemplateArray<class osg::Vec3f,28,3,5126> >::~ref_ptr<class osg::TemplateArray<class osg::Vec3f,28,3,5126> >(void)" (??1?$ref_ptr@V?$TemplateArray@VVec3f@osg@@$0BM@$02$0BEAG@@osg@@@osg@@QEAA@XZ) 中导入
1>AnimationCoordCallbackWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationCoordWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationMaterial.obj : warning LNK4049: 已导入本地定义的符号 ?unref@Referenced@osg@@QEBAHXZ (public: int __cdecl osg::Referenced::unref(void)const )
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ?notify@osg@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4NotifySeverity@1@@Z (class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl osg::notify(enum osg::NotifySeverity)) 在函数 "public: void __cdecl TDuExtend::AnimationCoord::write(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?write@AnimationCoord@TDuExtend@@QEBAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) 中导入
1>AnimationCoordWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?notify@osg@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4NotifySeverity@1@@Z (class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl osg::notify(enum osg::NotifySeverity))
1>AnimationMaterialWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?notify@osg@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4NotifySeverity@1@@Z (class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl osg::notify(enum osg::NotifySeverity))
1>AnimationTransformWrapper.obj : warning LNK4049: 已导入本地定义的符号 ?notify@osg@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4NotifySeverity@1@@Z (class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl osg::notify(enum osg::NotifySeverity))
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ??0Array@osg@@QEAA@W4Type@01@HIW4Binding@01@@Z (public: __cdecl osg::Array::Array(enum osg::Array::Type,int,unsigned int,enum osg::Array::Binding)) 在函数 "public: virtual class osg::Object * __cdecl osg::TemplateArray<class osg::Vec3f,28,3,5126>::cloneType(void)const " (?cloneType@?$TemplateArray@VVec3f@osg@@$0BM@$02$0BEAG@@osg@@UEBAPEAVObject@2@XZ) 中导入
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ??0Array@osg@@QEAA@AEBV01@AEBVCopyOp@1@@Z (public: __cdecl osg::Array::Array(class osg::Array const &,class osg::CopyOp const &)) 在函数 "public: virtual class osg::Object * __cdecl osg::TemplateArray<class osg::Vec3f,28,3,5126>::clone(class osg::CopyOp const &)const " (?clone@?$TemplateArray@VVec3f@osg@@$0BM@$02$0BEAG@@osg@@UEBAPEAVObject@2@AEBVCopyOp@2@@Z) 中导入
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ??1Array@osg@@MEAA@XZ (protected: virtual __cdecl osg::Array::~Array(void)) 在函数 "protected: virtual __cdecl osg::TemplateArray<class osg::Vec3f,28,3,5126>::~TemplateArray<class osg::Vec3f,28,3,5126>(void)" (??1?$TemplateArray@VVec3f@osg@@$0BM@$02$0BEAG@@osg@@MEAA@XZ) 中导入
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ?dirtyBound@Node@osg@@QEAAXXZ (public: void __cdecl osg::Node::dirtyBound(void)) 在函数 "public: virtual void __cdecl TDuExtend::AnimationCoordCallback::update(class osg::NodeVisitor *,class osg::Drawable *)" (?update@AnimationCoordCallback@TDuExtend@@UEAAXPEAVNodeVisitor@osg@@PEAVDrawable@4@@Z) 中导入
1>AnimationTransform.obj : warning LNK4217: 本地定义的符号 ?dirtyBound@Node@osg@@QEAAXXZ (public: void __cdecl osg::Node::dirtyBound(void)) 在函数 "protected: class std::_Tree_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint> > > > __cdecl std::_Tree<class std::_Tmap_traits<double,class TDuExtend::AnimationTransform::ControlPoint,struct std::less<double>,class std::allocator<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint> >,0> >::_Insert_at<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint> &,struct std::_Tree_node<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint>,void *> *>(bool,struct std::_Tree_node<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint>,void *> *,struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint> &,struct std::_Tree_node<struct std::pair<double const ,class TDuExtend::AnimationTransform::ControlPoint>,void *> *)" (??$_Insert_at@AEAU?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@std@@PEAU?$_Tree_node@U?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@std@@PEAX@2@@?$_Tree@V?$_Tmap_traits@NVControlPoint@AnimationTransform@TDuExtend@@U?$less@N@std@@V?$allocator@U?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@std@@@5@$0A@@std@@@std@@IEAA?AV?$_Tree_iterator@V?$_Tree_val@U?$_Tree_simple_types@U?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@std@@@std@@@std@@@1@_NPEAU?$_Tree_node@U?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@std@@PEAX@1@AEAU?$pair@$$CBNVControlPoint@AnimationTransform@TDuExtend@@@1@1@Z) 中导入
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ?setVertexArray@Geometry@osg@@QEAAXPEAVArray@2@@Z (public: void __cdecl osg::Geometry::setVertexArray(class osg::Array *)) 在函数 "public: virtual void __cdecl TDuExtend::AnimationCoordCallback::update(class osg::NodeVisitor *,class osg::Drawable *)" (?update@AnimationCoordCallback@TDuExtend@@UEAAXPEAVNodeVisitor@osg@@PEAVDrawable@4@@Z) 中导入
1>AnimationCoord.obj : warning LNK4217: 本地定义的符号 ?setNormalArray@Geometry@osg@@QEAAXPEAVArray@2@W4Binding@32@@Z (public: void __cdecl osg::Geometry::setNormalArray(class osg::Array *,enum osg::Array::Binding)) 在函数 "public: virtual void __cdecl TDuExtend::AnimationCoordCallback::update(class osg::NodeVisitor *,class osg::Drawable *)" (?update@AnimationCoordCallback@TDuExtend@@UEAAXPEAVNodeVisitor@osg@@PEAVDrawable@4@@Z) 中导入
1>AnimationTransformCallbackWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void))
1>AnimationTransformWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void))
1>AnimationCoordCallbackWrapper.obj : warning LNK4217: 本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void)) 在函数 "void __cdecl wrapper_propfunc_TDuExtend_AnimationCoordCallback(class osgDB::ObjectWrapper *)" (?wrapper_propfunc_TDuExtend_AnimationCoordCallback@@YAXPEAVObjectWrapper@osgDB@@@Z) 中导入
1>AnimationCoordWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void))
1>AnimationMaterialCallbackWrapper.obj : warning LNK4217: 本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void)) 在函数 "public: virtual __cdecl osgDB::TemplateSerializer<double>::~TemplateSerializer<double>(void)" (??1?$TemplateSerializer@N@osgDB@@UEAA@XZ) 中导入
1>AnimationMaterialWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??0Referenced@osg@@QEAA@XZ (public: __cdecl osg::Referenced::Referenced(void))
1>AnimationTransformCallbackWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void))
1>AnimationTransformWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void))
1>AnimationCoordCallbackWrapper.obj : warning LNK4217: 本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void)) 在函数 "public: virtual __cdecl osgDB::TemplateSerializer<double>::~TemplateSerializer<double>(void)" (??1?$TemplateSerializer@N@osgDB@@UEAA@XZ) 中导入
1>AnimationCoordWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void))
1>AnimationMaterialCallbackWrapper.obj : warning LNK4217: 本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void)) 在函数 "public: class osg::ref_ptr<class TDuExtend::AnimationMaterial> __cdecl osgDB::InputStream::readObjectOfType<class TDuExtend::AnimationMaterial>(void)" (??$readObjectOfType@VAnimationMaterial@TDuExtend@@@InputStream@osgDB@@QEAA?AV?$ref_ptr@VAnimationMaterial@TDuExtend@@@osg@@XZ) 中导入
1>AnimationMaterialWrapper.obj : warning LNK4049: 已导入本地定义的符号 ??1Referenced@osg@@MEAA@XZ (protected: virtual __cdecl osg::Referenced::~Referenced(void))
1>AnimationCoordCallbackWrapper.obj : warni
Saleayas 2019-01-19
  • 打赏
  • 举报
回复
库有两种,一种是导入库,一种是静态库。 导入库在使用的时候,需要 .dll 文件的。 所以你需要使用静态库。

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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