【发布时间】:2010-08-31 04:32:51
【问题描述】:
大家好,
我在我的项目中使用 MinGW、QT 和 CMake。
如图,我的项目有两个模块。
libRinzoCore.DLL - 一个共享库,它定义了一些抽象类和接口以及应用程序的一些核心功能。该模块用于实现动态插件(也是由应用程序自动加载的共享库)。
Rinzo.exe - 主应用程序。它使用“libRinzoCore”类。
“libRinzoCore”主要使用QT对象开发,并链接QT库。
“Rinzo.exe”也使用 QT 库对象,“libRinzoCore”中没有使用一些对象。所以我必须将 QT 库和“libRinzoCore”与此可执行文件链接。
我可以毫无问题地编译“libRinzoCore”,它生成了两个文件“libRinzoCore.DLL”和“libRinzoCore.DLL.a”
但在编译“Rinzo.exe”时,它会给出以下输出:
Linking CXX executable Rinzo.exe
Info: resolving IRzPlugin::staticMetaObject by linking to __imp___ZN9IRzPlugin16staticMetaObjectE (auto-import)
Info: resolving IRzViewerPlugin::staticMetaObject by linking to __imp___ZN15IRzViewerPlugin16staticMetaObjectE (auto-import)
Info: resolving IRzLayeringPlugin::staticMetaObject by linking to __imp___ZN17IRzLayeringPlugin16staticMetaObjectE (auto-import)
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.
[100%] Built target Rinzo
当执行“Rinzo.exe”时,它会崩溃并显示消息(这是从日语错误消息翻译而来)
" 应用程序无法执行 正确(0xc0000005)。点击【确定】即可 取消“
这是我的 CMake 文件
libRinzoCore:
http://www.keepandshare.com/doc/2199086/rinzocore-txt-august-31-2010-12-10-pm-2k?da=y
Rinzo.exe:
http://www.keepandshare.com/doc/2199085/rinzo-txt-august-31-2010-12-10-pm-5k?da=y
如果我将“libRinzoCore”编译为静态库,它可以正常工作。 在 Linux 上运行良好。
有什么建议吗?
【问题讨论】:
标签: c++ qt shared-libraries mingw cmake