qt-mysql driver conflits with Webkit on compilation

news/2024/7/5 23:28:22 标签: compilation, webkit, mysql, header, qt, installer

When i compliing mysql driver for qt47 in mac os, an error is threw :

> bindings/js/JSPluginCustom.cpp:38: error: invalid use of incomplete type 
> ‘struct WebCore::Plugin’
> generated/JSPlugin.h:30: error: forward declaration of ‘struct 
> WebCore::Plugin’
> make[2]: *** [.obj/debug-shared/JSPluginCustom.o] Error 1
> make[1]: *** [debug-all] Error 2
> make: *** [sub-webkit-make_default-ordered] Error 2

read the source code, found the reason is there r two Plugin.h header file in the  g++ include path.

one is from qt source at $QTDIR/src/3rdparty/webkit/WebCore/plugins/Plugin.h and the other is come from the mysql header files.

in the file where the exception threw, the code

class Plugin;
is ambiguous.

I search the web for more infomation but there are only 2 way to solve this problem.

one is the macport provide an diff file for their own qt-mac package installer, so it is not general solution.

and the other way is remove the plugin.h. owned by mysql-source but only configure -release can make succ, the -debug or -release-and-debug mode remain wrongs.

it's terrible if i dev my project under an non-debug-tools-env.

after serveral hours i found a way to solve this boring problem, compiled the qt with mysql driver under the -release-and-debug mode in MacOs.

the solution is rough but it really Works correctly!

1.certainly u should backup your mysql header files first.

2.copy the content of the qt's Plugin.h and paste it into the mysql's plugin.h

(Notice : only one file is modified : the mysql plugin.h which is include by configure -Ixxxx )

3.copy the mysql header files into the qt directory. The the files structure in this directory would like this :

$QTDIR/src/3rdparty/webkit/WebCore/plugins/

                                                                                  Plugin.h

                                                                                  ....

                                                                                  mysql/

                                                                                             plugin.h

                                                                                             other mysql headers such as services.h

coz mysql plugin.h would #include "mysql/services.h" and some others, so solve it directly by `cp`.

4.qt configure & make & make install. waiting for the qt make result.



да товарищ, job done!


http://www.niftyadmin.cn/n/1858943.html

相关文章

mysql中连接失败2003错误解决办法

在使用mysql数据库,新建连接时,会报2003-Cant connect to server on localhost(10038)错误,原因主要是MYSQL服务没有启动起来,但是进入:计算机——管理——服务中,找不到MYSQL服务,主要解决办法…

4.4二叉树的存储结构

4.4二叉树的存储结构 顺序存储 定义:用一组地址连续的存储单元依次自上而下,自左至右存储完全二叉树上的结点元素。 这种存储浪费存储空间所以考虑链式。 链式存储: 二叉树每个结点最多两个孩子,所以设计二叉树的结点结构时堪…

4.5二叉树的遍历

4.5二叉树的遍历 定义:二叉树的遍历是指按某种次序依次访问树中的每个结点,是得每个结点均被访问一次。 (递归) 1.先序遍历 操作过程: 为空,什么也不做;(递归边界) …

android事件系列-onTouch事件与手势操作

提示记忆:应用流程:在Activity中对控件执行 view.setOnTouchListener( OnTouchListener i);实现里面的OnTouchListener 接口中的方法,重点再于理解里面的方法的实现步骤,触摸,手势操作已经很好的融入了我们的生活。那么…

qt整合全文检索功能(1)中文分词以及获得词频

qt在新版本中整合了qtlucene的组件,单位的机器qt版本不够,也懒得升级。先看一下中文切分词部分。 目的:对文档进行中文切分,并根据词频高低排序。 选择LibMMSeg 作为切分词组件。 下载源码, ./bootstrap ./conf…

4.6线索化二叉树

4.6线索化二叉树 (不用栈实现二叉树的非递归遍历) note: N个结点的二叉链表,每个结点都有指向左右孩子的结点指针,所以一共有2*N个指针,而N个结点的二叉树一共由N-1个分支,也就是说有N1个空指…

Failed to create java virtue machine(不能创建java虚拟机)

今天开发模块时,遇到这个问题,本来是版本的问题,jdk1.6的版本有点低,与cxf框架不兼容,需要用到jdk1.7,结果安装了jdk1.7之后,客户方要求必须用jdk1.6,要统一,所以卸载jdk…

4.7哈夫曼树和哈夫曼编码

4.7哈夫曼树和哈夫曼编码 概念: 权:树中结点相关的数据 路径长度:从树中某个结点到另外一个结点之间的分支数目(经过的边数) 带权路径的长度:从树的根结点到任意结点的路径长度(经过的边数)与该结点上权…