Mingw64编译wxWidgets3.0.2常见错误
使用Mingw64编译wxWidgets3.0.2,首先得下载wxMSW-Setup-3.0.2.exe(https://sourceforge.net/projects/wxwindows/files/3.0.2/wxMSW-Setup-3.0.2.exe,然后按照如下步骤编译(假设要编译一个Unicode共享库版的wxWidgets):
cd X:\wxWidgets-3.0.2\build\msw
make -f makefile.gcc SHARED=1 UNICODE=1
然而编译到一半,从C代码变为C++代码时,就会产生如下错误(有许多类似错误,只选取一处):
In file included from e:\mingwd\mingw\include\c++\5.2.0\type_traits:35:0,
from ..\..\include/wx/strvararg.h:25,
from ..\..\include/wx/string.h:46,
from ..\..\include/wx/any.h:19,
from ../../src/common/any.cpp:18:
e:\mingwd\mingw\include\c++\5.2.0\bits\c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
既然只是c++11支持没有打开的问题,只要改一下CXXFLAGS即可,于是乎,按如下命令重新编译。
make -f makefile.gcc CXXFLAGS="-std=c++11" SHARED=1 UNICODE=1 clean
make -f makefile.gcc CXXFLAGS="-std=c++11" SHARED=1 UNICODE=1
这次编译完了所有中间件,但是到链接时候又出了问题:
E:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filename.o): In function `wxChmod(wxString const&, unsigned short)':
E:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:513: undefined reference to `wxMSLU__wchmod(wchar_t const*, int)'
E:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filename.o): In function `wxOpen(wxString const&, int, unsigned short)':
E:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:515: undefined reference to `wxMSLU__wopen(wchar_t const*, int, int)'
E:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_file.o): In function `wxRemove(wxString const&)':
E:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:758: undefined reference to `wxMSLU__wremove(wchar_t const*)'
E:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_file.o): In function `wxAccess(wxString const&, unsigned short)':
......
这实在是令我百思不得其解了,翻遍了docs文件夹的每个角落,终于在install.txt中找到了答案,里面有这么一句话:
C++11 note: If you want to compile wxWidgets in C++11 mode, you currently have
to use -std=gnu++11 switch as -std=c++11 disables some extensions
that wxWidgets relies on. I.e. please use CXXFLAGS="-std=gnu++11".
说的很清楚,不能用”std=c++11"进行编译,这会导致一些wxWidgets依赖的extensions(扩展名?)被屏蔽的问题。然后用以下命令重新编译,就成功了。
make -f makefile.gcc CXXFLAGS="-std=gnu++11" SHARED=1 UNICODE=1 clean
make -f makefile.gcc CXXFLAGS="-std=gnu++11" SHARED=1 UNICODE=1
后记
上面说到关于extensions,这里的意思应该是扩展,即gnu的g++(gcc)提供给c/c++代码除c++标准以外的支持。如果这些支持没有被启用,自然会导致上面像wxWidgets的库编译失败,不过这么依赖语言外的额外实现也不见得是件好事吧。
Mingw64编译wxWidgets3.0.2常见错误的更多相关文章
- 编译 wxWidgets-3.0.2 on Mac OS X Yosemite 出错?!的解决方法
tar -zxf wxWidgets-3.0.2.tar.bz2 //解压 //三部走 ./configure ./make 提示webKit出错 原因:有人偷懒,没试编译就发布了. 解决:找到. ...
- ADS中编译现存项目时常见错误:无法打开文件\…\…\2440init.o的解决办法
错误提示如下: 解决方法: 重新编译即可.
- mysql编译安装后各种常见错误集锦
1.ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', sys ...
- 在64位Ubuntu上编译32位程序常见错误
问 题1: 找不到头文件 asm/errno.h 解决办法 : [/usr/lib/gcc$ ]sudo ln -s x86_64-linux-gnu/asm asm 问题2:找不到gcc ...
- CentOS编译PHP过程中常见错误信息的解决方法
原文链接:http://www.linuxidc.com/Linux/2014-05/102327.htm ********************************************** ...
- Ubuntu(64位)编译Android源码常见错误解决办法
2013年07月10日 14:47:27 阅读数:1239 错误: /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file ...
- JDBC 连接 MySQL 8.0.15+ 常见错误记录
课后复习 1. No suitable driver found for mysql:jdbc://localhost:3306/test 错误原因: mysql:jdbc://localhost:3 ...
- 编译php时出现xsl错误的解决方法
是因为系统没安装一个叫 libxslt-devel 的包, 安装上就好了. 附编译php时的常见错误: http://www.myhack58.com/Article/sort099/sort0102 ...
- Qt 4.8.6 PCL 1.8.0 VS 2010 联合编译常见错误
在Qt和PCL联合编译的过程中,会出现各种各样的错误,解决这些错误的过程真是痛苦万分,所以总结一些常见错误方便自己也方便他人.比如我们要编译PCL1.8.0中的apps中的point_cloud_ed ...
随机推荐
- 【转】Installing the libv8 Ruby gem on Centos 5.8
转自:http://appsintheopen.com/posts/18-installing-the-libv8-ruby-gem-on-centos-5-8 First, Centos 5.8 s ...
- Android Activity切换动画overridePendingTransition
Activity在切换或者是退出的时候能够使用渐入,滑动,缩放等动态效果.使用的就是方法overridePendingTransition,能够直在Activity其中直接调用. overridePe ...
- synthesize(合成) keyword in IOS
synthesize creates setter and getter (从Objective-C 2.0开始,合成可自动生成存取方法) the setter is used by IOS to s ...
- Codeforces Round #331 (Div. 2) E. Wilbur and Strings dfs乱搞
E. Wilbur and Strings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596 ...
- 不可不表的OSG智能指针之强指针与弱指针 《转载》
不可不表的OSG智能指针之强指针与弱指针 <转载> 使用OSG的人都知道OSG的内存管理方式采用了智能指针,通过智能指针的方式让OSG自己处理对象的销毁工作.在OSG中有两个智能指针类型, ...
- delphi 获取 TreeView选中的文件路径
//获取 TreeView选中的文件路径 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, G ...
- 现在的SEO最须要会点啥
如今的SEO最须要会点啥,会飞天,会遁地,NONONO,不须要你这么流弊,咳咳,不瞎扯.在以往SEO的就是从搜索引擎中获取免费流量.是啊,曾经多好弄啊.而如今在我们不但须要流量还须要把流量进行转换,毕 ...
- iOS开发——数据解析Swift篇&简单json数据处理
简单json数据处理 //loadWeather var url = NSURL(string: "http://www.weather.com.cn/adat/sk/101240701.h ...
- 一个公网地址部署LVS/DR模式
http://blog.chinaunix.net/uid-7411781-id-3436142.html 一个公网地址部署LVS/DR模式 网上看了很多关于LVS的文章,在选取2种模式LVS/D ...
- UWSGI安装与使用
http://blog.csdn.net/chenggong2dm/article/details/43937433 http://blog.csdn.net/orangleliu/article/d ...