Solved: Qt Library LNK 2001 staticMetaObject error
在链接Qt的库,比如QtGui4.lib,我这里是在链接QtSolutions_PropertyBrowser-head.lib的时候出现的链接错误。大概是说一个“XXXX::staticMetaObject”的函数找不到定义。解决办法是,在include该Qt库的头文件时定义“__declspec(dllimport)”,对于QtSolutions_PropertyBrowser-head库,在其头文件qtpropertybrowser.h中有:
#if defined(Q_OS_WIN)
# if !defined(QT_QTPROPERTYBROWSER_EXPORT) && !defined(QT_QTPROPERTYBROWSER_IMPORT)
# define QT_QTPROPERTYBROWSER_EXPORT
# elif defined(QT_QTPROPERTYBROWSER_IMPORT)
# if defined(QT_QTPROPERTYBROWSER_EXPORT)
# undef QT_QTPROPERTYBROWSER_EXPORT
# endif
# define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllimport)
# elif defined(QT_QTPROPERTYBROWSER_EXPORT)
# undef QT_QTPROPERTYBROWSER_EXPORT
# define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllexport)
# endif
#else
# define QT_QTPROPERTYBROWSER_EXPORT
#endif
也就是在链接QtSolutions_PropertyBrowser-head库时只要定义了QT_QTPROPERTYBROWSER_IMPORT宏即可。我在Makefile的CPPFLAGS(使用的是VS2010编译器)加入了-DQT_QTPROPERTYBROWSER_IMPORT,编译通过。
Solved: Qt Library LNK 2001 staticMetaObject error的更多相关文章
- 如何编译和使用自定义Qt动态链接库 | how to build and use user-defined qt library
本文首发于个人博客https://kezunlin.me/post/cf628dd8/,欢迎阅读! guide to build qt library and use in another proje ...
- Cannot mix incompatible Qt library (version 0x40805) with this library (version 0x40801)
问题描述 今天运行我的 linux 上的 go 语言 IDE liteide 突然报错,错误如下: Cannot mix incompatible Qt library (version 0x4080 ...
- Qt官方对OpenSSL的编译方法的描述,单独下载的Qt library则一般不带SSL(包括QT FAQ)
https://wiki.qt.io/MSYS2http://wiki.qt.io/Compiling_OpenSSL_with_MinGWhttps://wiki.qt.io/MinGW-64-bi ...
- SevenZip.SevenZipLibraryException: Can not load 7-zip library or internal COM error! Message: failed to load library.
SevenZip.SevenZipLibraryException: Can not load 7-zip library or internal COM error! Message: failed ...
- QT编译错误:Project ERROR: This example requires Qt to be configured with -opengl desktop
学习QT场景视图,对一个Boxes的例子比较感兴趣,于是去编译学习,结果编译不能通过(使用的是QT5.12): Project ERROR: This example requires Qt to b ...
- Qt新安装之后出现Error while building/deploying (kit: Desktop Qt 5.7.0 GCC 64bit) When executing step "Make”
Ubuntu14.04初次安装Qt之后可能出现Error while building/deploying project *** (kit: Desktop Qt 5.7.0 GCC 64bit ...
- 单独下载的Qt library则一般不带SSL(包括QT FAQ)
http://www.cnblogs.com/E7868A/archive/2012/11/15/2771501.html http://www.oldcai.com/archives/208 htt ...
- Qt Library 链接库
官方教程:http://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application http://qimo601.i ...
- Cannot mix incompatible Qt library (version 0x40801) with this library (version 0x40804)
安装EMAN2(单颗粒重构的软件)之后,运行e2projectmanager.py来启动程序出现了这个错误. 去网上找了一下,发现一个靠谱的方案,这个问题出现是由于EMAN2这个程序自带了Qt的库,而 ...
随机推荐
- wiredtiger - hazard pointers
http://www.drdobbs.com/lock-free-data-structures-with-hazard-po/184401890 memory deallocation lock- ...
- python 多线程编程
这篇文章写的很棒http://blog.csdn.net/bravezhe/article/details/8585437 使用threading模块实现多线程编程一[综述] Python这门解释性语 ...
- 第三天:DOM EventListener 句柄的添加和移除
1.事件句柄的包含如下两个方法: ps:使用句柄的好处是,修改方法的名称时,不需要改变多处 1.添加一个句柄, 2.添加多个句柄不会覆盖,运行结果:点击“按钮”,弹出框hello,确定后,自动弹出框w ...
- 安装SQLSERVER2012遇到的一些问题
安装SQLSERVER2012遇到的一些问题 先到MSDN我告诉你http://msdn.itellyou.cn/下载安装包,我每次都到MSDN我告诉你里下载的,因为那里的安装包保证能用 我的环境是: ...
- iis php5.3.8 默认文档无效 404 - 找不到文件或目录
环境:WIN2008 R2 IIS7.5 / .NET4.X 新开1站点,使用php(5.3.8),默认首页文档已设置为index.php,网站所在目录的网站运行时用户权限正确,应用程序池是asp.n ...
- xampp连接Admin界面报错
报错信息: phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You s ...
- git查看一个文件的历史记录
git log --all -- '*'FILENAME'*' 支持模糊查询 主要用于查找历史上被删除的文件 可以做成git的一个快捷命令 find = "!f(){ git log --a ...
- Fiddler初探
我们知道监视Http和Https请求的工具有多种,例如:HttpWatch,FireBug等.但是今天接触到一种新的工具Fiddler.Fiddler能记录所有客户端和服务器的http和https请求 ...
- [备忘][转]rsync使用时的常见问题
sync使用时的常见问题: 错误1: rsync: read error: Connection reset by peer (104) rsync error: error in rsync pro ...
- eclipse运行maven的jetty插件内存溢出
系统运行在Maven中的Jetty插件下,当在Eclipse运行clean jetty:run时,系统提示OutOfMemoryError: PermGen space.解决办法:设置run as - ...