wxWidgets学习笔记(1) Mac osx 下环境配置

 

  由于最近在学习《Ray Tracing from thee Ground Up》,书中的示例程序是使用wxWidgets这个跨平台图形API写的,故学习了下,记录下来以便复习。

  关于wxWidgets的相关消息可以参见官方网站 http://www.wxwidgets.org/查看更多信息。

(1)编译源文件

  下载Mac OSX版本的源文件,用Xcode打开build/osx/wxcocoa.xcodeproj文件,点击编译,等待编译过程。

  编译过程中出现错误“cannot initialize variable of type 'WebBackForwardList *with an rvalue of type 'WKBackForwardList *WebBackForwardListhistory [m_webView backForwardList];”。查找相关资料后,见到下面这段话:

This is a reported bug with wxWidgets-3.0.2 that only occurs on Yosemite. The reason for this bug is that Apple updated it’s Headers for Webkit. Fortunately, the old headers still exist in a header file called WebkitLegacy.h. This bug, however is fixed in the 3.0.3 version of the library, but isn’t still available for download (you can still get that by cloning the wxwidgets repo). Currently to fix this, all you need to edit a file src/osx/webview_webkit.mm and look for line 31.

可见这是在Yosemite系统的上的一个BUG,因为苹果公司更新了WebKit的头文件,在src/osx/webview_webkit.mm的31行找到如下代码:

#include <WebKit/WebKit.h>

The above is the line 31 of the source file wxWidgets-3.0.2/src/osx/webview_webkit.mm. All you need to do is to replace that line with the following alternative.

将这段注释掉,替换成下面这段代码:

#include <WebKit/WebKitLegacy.h>

详情参见:http://goharsha.com/blog/compiling-wxwidgets-3-0-2-mac-os-x-yosemite/

继续编译,知道最后成功完成。

(2) Xcode上创建新项目

  具体操作参考:https://wiki.wxwidgets.org/Creating_Xcode_projects_for_wxWidgets_applications

 (图片资源来自于网络,如有不妥请联系笔者删除)

设置完后会出现编译错误,如下:

Info_cocoa.plist 改为 “Info.plist”加入工程目录文件夹XXXTests中。

转载于:https://www.cnblogs.com/kyleljj/p/4391385.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值