解决SkyP2M工程常见问题所参考的博客汇总

工程是基于64位的
1
Error 26 error C2491: 'HUDManager::_viewport' : definition of dllimport static data member not allowed E:\SkyP2M_V1.0\pmVisualization\pmVisualization\HUDManager.cpp 8 osgPC 1

VS下 dllimport与dllexport作用与区别 :https://www.cnblogs.com/foohack/p/4119207.html
简单直接介绍:https://www.cnblogs.com/nzbbody/p/3448385.html
加上预定义宏“PMVISUALIZATION_EXPORT_LIBRARY” : https://blog.csdn.net/gengxt2003/article/details/6417780
2
Error 84 error C1189: #error : ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. E:\SkyP2M_V1.0\code_lib64\include\glog\log_severity.h 55 osgPC 1

关于Glog/log_severity.h 日志使用中预定义宏冲突的解决: http://www.voidcn.com/article/p-mkgmbinx-bdc.html
3
Error 140 error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall osg::Node::ascend(class osg::NodeVisitor &)" (_imp?ascend@Node@osg@@UAEXAAVNodeVisitor@2@@Z) E:\SkyP2M_V1.0\pmPanoramaCache\pmPanoramaCache\create_panorma.obj pmPanoramaCache
工程由32位调整为64位

调整之后,回车保存。此问题的产生的原因是该工程是为64位机器运行而做的配置。

4
Error 4 error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. E:\SkyP2M_V1.0\code_lib64\include\flann\util\serialization.h 362 RoadMarkingExtraction 1
理解及解决方案:https://blog.csdn.net/lbc2100/article/details/79884053

5
Error 31 error C2589: '(' : illegal token on right side of '::' E:\SkyP2M_V1.0\code_lib64\include\pcl\correspondence.h 75 SemiAutoObjectExtraction 1
通过括号“()”来避免预编译器报错:https://www.cnblogs.com/wenshanzh/p/3586412.html
原理:https://blog.csdn.net/clever101/article/details/79443301
加括号前:

加括号后:

6
Error 19 error C2446: '<=' : no conversion from 'std::numeric_limits::_Ty (__cdecl *)(void) throw()' to 'Scalar' E:\SkyP2M_V1.0\code_lib64\include\pcl\common\impl\eigen.hpp 262 SemiAutoObjectExtraction 1
原理:windows.h中定义了min宏,中也有这个定义,两者冲突了。windows.h中Microsoft定义了min/max两个宏,< limits >中定义的min/max两个宏虽然在自己的命名空间中,可还是被“污染”了。因此要避免冲突,就得先屏蔽windows.h中定义的min宏,具体做法是在所有包含头文件前面(注意是所有)增加下面的预处理语句。https://blog.csdn.net/clever101/article/details/79443301
可能是解决方案:https://social.msdn.microsoft.com/Forums/vstudio/en-US/e94865f7-84cd-4912-8339-6ee95fb58825/numericlimitsltdoublegtmax-not-recognized?forum=vcgeneral

同时做了如下 调整

7 qt+vc2013:https://www.jianshu.com/p/74f1e8b89078

8
6974 IntelliSense: identifier "QT3_SUPPORT_CONSTRUCTOR" is undefined e:\SkyP2M_V1.0\code_lib64\qt_4.8.6\src\gui\kernel\qaction.h 106 SkyP2M 5
6976 IntelliSense: expected an identifier e:\SkyP2M_V1.0\code_lib64\qt_4.8.6\src\gui\widgets\qmenu.h 198 SkyP2M 12
问题出在我的QT版本,我用的是5.7,实际原有工程使用的是4.8.6。只需要重新安装QT并修改对应的目录即可
是由于这篇博客让我想到了是版本问题导致的:https://blog.csdn.net/zouyu1746430162/article/details/78069726
9
关于build和rebuild
https://www.cnblogs.com/tylerdonet/archive/2012/02/03/2336985.html
MSDN中的生成和编辑参考资料:https://docs.microsoft.com/zh-cn/cpp/build/reference/c-cpp-building-reference?view=vs-2019

10
关于Debug和Release
https://www.cnblogs.com/cwwmmv/p/9151386.html

11
关于添加自定义的目录宏:有两种方法,一种是环境变量,但是要重启VS;一种是属性管理器。
https://blog.csdn.net/chinabinlang/article/details/12774209

12
添加环境变量CODE_LIB64和环境变量QTDIR,同时在path里面要添加"%CODE_LIB64%\bin;"
缺少部分的dll,如下图,应该是对应的运行目录没有配置到环境变量

解决方法:

13 理解QApplication 与QMainWindow和QWidget之间的关系
https://blog.csdn.net/huang1600301017/article/details/88019132

posted @ 2019-04-26 17:09  DowTowne  阅读(332)  评论(0编辑  收藏  举报