终于……我的qt可以build了,内牛满面,记录qlocale.cpp:6528error心路历程
2010-11-06 23:08
295 查看
纠结了1个月的时间,终于在今天晚上,就在今天就在今天(用天津话说效果更佳),我的qt竟然可以build了,写下日志记录下,顺便惊讶一下,国内竟然没有一个大神给出正确解释(或是我没找到,或是你们不屑?),这叫老夫情何以堪……
问题如下:9月末开始钻研qt,从Eclipse开始搭建平台,按照网络搜的安装指南一步一步有条不紊,很快进行将Eclipse和cdt建好了,mingw和gdb稍后完成了,小试了一下Eclipse已经可以编译c++代码了,debug也顺利使用,紧接着下一步开始架设qt了。到nokia官网上下载qt-Eclipse-integration和qt4.7.0的新版库,下一步下一步的安装方法我表示压力不大。安装完成并在Eclipse中设置好qt库的路径后,似乎大功告成了,试用了下helloworld可以编译,可是问题来了,Eclipse中竟然无法生成release版文件和使用debug,万般无奈中用了将近半个月的无debug版qt。
直到半个月前,我偶然从朋友处得知需要在mingw中编译qt的库才可以使用qt的debug功能,于是我正常的使用configuration和Makefile,很不幸的遇到了
qlocale.cpp:6528error
查阅了很多国内高人的文章,办法似乎都不能有效解决这个问题,一直到我看到在qt官网一个提交bug的分页中http://bugreports.qt.nokia.com/,有人与我遇到类似的问题,位于[#qtbug-7576],解决问题的原文如下:
Both mingw and gcc have a float.h. The mingw version supplements the gcc version, declaring _clear87 and _control87 among other things. The mingw version has an #include_next which is meant to include the gcc version. This works only when the mingw include dir is first in the header search path.
In the gcc 4.4 mingw package from Qt, the mingw include dir is first. That's why it works. However, it probably should not be first. (I don't know why it's that way or who did it.)
But, often in other gcc/mingw installations the mingw include directory is last. In this case the gcc version is found first which leaves _clear87 and _control87 undeclared.
The easy and perhaps correct workaround is probably to move the #include_next<float.h> from the mingw version into the gcc version.
看来问题出在float.h这个头文件上,mingw中float和gcc中的float似乎在联系上有点问题,在编译qt的库时,我们需要让mingw的float中的#include_next<float.h>移动到gcc的float中,这样就能解决这个编译问题而来。至于为什么是这样就不明白了。。。求指教。
解决这个问题后,qt的编译和makefile就正常了,心情无限好啊,为了防止下次再次编译引起麻烦,我已经把整个库刻盘了。现在开始享受在Eclipse中使用qt的快感吧。
问题如下:9月末开始钻研qt,从Eclipse开始搭建平台,按照网络搜的安装指南一步一步有条不紊,很快进行将Eclipse和cdt建好了,mingw和gdb稍后完成了,小试了一下Eclipse已经可以编译c++代码了,debug也顺利使用,紧接着下一步开始架设qt了。到nokia官网上下载qt-Eclipse-integration和qt4.7.0的新版库,下一步下一步的安装方法我表示压力不大。安装完成并在Eclipse中设置好qt库的路径后,似乎大功告成了,试用了下helloworld可以编译,可是问题来了,Eclipse中竟然无法生成release版文件和使用debug,万般无奈中用了将近半个月的无debug版qt。
直到半个月前,我偶然从朋友处得知需要在mingw中编译qt的库才可以使用qt的debug功能,于是我正常的使用configuration和Makefile,很不幸的遇到了
qlocale.cpp:6528error
查阅了很多国内高人的文章,办法似乎都不能有效解决这个问题,一直到我看到在qt官网一个提交bug的分页中http://bugreports.qt.nokia.com/,有人与我遇到类似的问题,位于[#qtbug-7576],解决问题的原文如下:
Both mingw and gcc have a float.h. The mingw version supplements the gcc version, declaring _clear87 and _control87 among other things. The mingw version has an #include_next which is meant to include the gcc version. This works only when the mingw include dir is first in the header search path.
In the gcc 4.4 mingw package from Qt, the mingw include dir is first. That's why it works. However, it probably should not be first. (I don't know why it's that way or who did it.)
But, often in other gcc/mingw installations the mingw include directory is last. In this case the gcc version is found first which leaves _clear87 and _control87 undeclared.
The easy and perhaps correct workaround is probably to move the #include_next<float.h> from the mingw version into the gcc version.
看来问题出在float.h这个头文件上,mingw中float和gcc中的float似乎在联系上有点问题,在编译qt的库时,我们需要让mingw的float中的#include_next<float.h>移动到gcc的float中,这样就能解决这个编译问题而来。至于为什么是这样就不明白了。。。求指教。
解决这个问题后,qt的编译和makefile就正常了,心情无限好啊,为了防止下次再次编译引起麻烦,我已经把整个库刻盘了。现在开始享受在Eclipse中使用qt的快感吧。
相关文章推荐
- qt 写类似通话记录,通信录这样的东西可以用listwidget
- crazyflie2终于可以连接到PC client -- 记录下之前遇到的困难和解决方法
- 等了三天,终于可以发表了。在这里记录下学习JAVA软件开发成长中的一点一滴
- 终于可以记录了,呵呵~(maven视屏学习记)
- 如何将Qt Designer 产生的*.UI文件转换成QT可以使用的*.H和*.CPP
- 终于抽出时间了,可以写自己的博客了,希望能够记录自己的学习和生活过程,与朋友共勉
- windows下编译qt的mysql驱动,终于成功了,一定记录下
- 记录一些可以查询Qt资料的地址
- 刚刚完成了在vs2013中通过 ef连接mysql数据库的工作。感觉没有想象中的简单。试了n次终于成功。故记录成功的方法,希望可以帮到大家
- 在Qt下静态编译OpenCV过程记录
- 终于可以去好好的学习了
- 终于可以舒服的看电子书了
- OpenCV终于可以进入函数调试了
- Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
- 开发板和qt中文显示异常解决方法记录
- 终于出了一个build
- ActiveX终于可以从服务器自动下载并注册了
- 时隔半个月终于可以上blog,发邮件了
- Qt编写的简单象棋程序 chessbroad.cpp
- 小白记录~hibernate旧石器时代方法buildSessionFactory();连接MySQL方法