首页 / 浏览问题 / 组件GIS / 问题详情
无法解析的外部符号 "QMapControl::mouseMoveEvent
1EXP 2019年11月18日
使用产品:supermap-iobjectscpp-10.0.0-17726-74479-win-all 操作系统:win10 x64

联系方式QQ:253292782

按照帮助文档用iObject c++ 实现GettingStarted案例过程中,生成解决方案是出现以下错误

1>------ 已启动全部重新生成: 项目: Application, 配置: Debug Win32 ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(452,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (QtGuiApplication1.vcxproj).  This can lead to incorrect clean and rebuild behavior.
1>Reading Qt configuration (D:\Qt\Qt5.9.0\5.9\msvc2015\bin\qmake.exe)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(452,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (QtGuiApplication1.vcxproj).  This can lead to incorrect clean and rebuild behavior.
1>uic GettingStarted.ui
1>rcc GettingStarted.qrc
1>moc GettingStarted.h
1> RCC: Warning: No resources in 'C:\Users\boss\source\repos\QtGuiApplication1\GettingStarted.qrc'.
1>GettingStarted.cpp
1>main.cpp
1>qrc_GettingStarted.cpp
1>moc_GettingStarted.cpp
1>D:\QtProjects\supermap-iobjectscpp-10.0.0-17726-74479-win-all\sample\extensions4Qt\qmapdrawthread.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 GettingStarted.cpp)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall QGISWidget::enterEvent(class QEvent *)" (?enterEvent@QGISWidget@@UAEXPAVQEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::focusOutEvent(class QFocusEvent *)" (?focusOutEvent@QMapControl@@MAEXPAVQFocusEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::keyPressEvent(class QKeyEvent *)" (?keyPressEvent@QMapControl@@MAEXPAVQKeyEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall QGISWidget::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QGISWidget@@UAEXPAVQKeyEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall QGISWidget::leaveEvent(class QEvent *)" (?leaveEvent@QGISWidget@@UAEXPAVQEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall QGISWidget::mouseDoubleClickEvent(class QMouseEvent *)" (?mouseDoubleClickEvent@QGISWidget@@UAEXPAVQMouseEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::mouseMoveEvent(class QMouseEvent *)" (?mouseMoveEvent@QMapControl@@MAEXPAVQMouseEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::mousePressEvent(class QMouseEvent *)" (?mousePressEvent@QMapControl@@MAEXPAVQMouseEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::mouseReleaseEvent(class QMouseEvent *)" (?mouseReleaseEvent@QMapControl@@MAEXPAVQMouseEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::paintEvent(class QPaintEvent *)" (?paintEvent@QMapControl@@MAEXPAVQPaintEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::resizeEvent(class QResizeEvent *)" (?resizeEvent@QMapControl@@MAEXPAVQResizeEvent@@@Z)
1>GettingStarted.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QMapControl::wheelEvent(class QWheelEvent *)" (?wheelEvent@QMapControl@@MAEXPAVQWheelEvent@@@Z)
1>C:\Users\boss\source\repos\QtGuiApplication1\Win32\Debug\\Application.exe : fatal error LNK1120: 12 个无法解析的外部命令
1>已完成生成项目“QtGuiApplication1.vcxproj”的操作 - 失败。
1>已完成生成项目“QtGuiApplication1.vcxproj”的操作 - 失败。
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

1个回答

您好,重新编译Extensions4Qt了吗?
694EXP 2019年11月18日
没有,直接使用Qmake 编译么?
用Qt打开编译一次即可。
mingw和vc++都可以么?
原则上是可以,我们提供的产品是以MSVC 2012编译的。
我有个问题呀,如果Extensions4Qt需要重新编译,那其他的lib库就不需要编译了么?
其他的不需要啊,是和Qt已经你的项目配置无关的。Extensions2Qt是Qt项目,没找到,是这个项目对Qt不同版本的兼容问题,修改这些Qt项目即可。

你的编译错误显示的就是找不到Extensions4Qt中的库,没有说找不到SuperMap/libs下的UGC什么的库吧。
这种问题,要么是编译的不对,要么是指定的库路径不对,检查一下你的编译结果输出的目录。
...