qt-mysql driver conflits with Webkit on compilation

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!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值