Wxwidgets Study Notes (1) MAC OSX environment configuration

Source: Internet
Author: User
Tags wxwidgets

As a result of the recent study of "Ray Tracing from thee Ground up", the sample program in the book is written using the Wxwidgets cross-platform graphics API, so it is learned and recorded for review.

Information about wxwidgets can be found on the official website http://www.wxwidgets.org/See more.

(1) Compiling source files

Download the Mac OSX version of the source file, open the Build/osx/wxcocoa.xcodeproj file with Xcode, click Compile, and wait for the compilation process.

Error occurred during compilation "cannot initialize a  variable of type  webbackforwardlist * '  with < span class= "n" >an rvalue of type  ' wkbackforwardlist *   webbackforwardlist* history = < Span class= "p" >[m_webview backforwardlist

This was a reported bug with wxWidgets-3.0.2, only occurs on Yosemite. The reason for this bug was that Apple updated it's Headers for Webkit. Fortunately, the old headers still exist in a header file called WebkitLegacy.h . This bug, however are 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 of you need to edit a file and look for line src/osx/webview_webkit.mm 31.

This is a bug on the Yosemite system, as Apple updated the WebKit header file to find the following code in the 31 lines of SRC/OSX/WEBVIEW_WEBKIT.MM:

#include <WebKit/WebKit.h>

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

Remove this comment and replace it with the following code:

#include <WebKit/WebKitLegacy.h>

For details, see: http://goharsha.com/blog/compiling-wxwidgets-3-0-2-mac-os-x-yosemite/

Continue compiling, knowing that the last successful completion.

(2) Create a new project on Xcode

Specific operation reference: Https://wiki.wxwidgets.org/Creating_Xcode_projects_for_wxWidgets_applications

(Picture resources from the network, if there is inappropriate, please contact the author delete)

A compilation error occurs after the setup is complete, as follows:

Info_cocoa.plist to "Info.plist" into the Project Catalog folder xxxtests.

Wxwidgets Study Notes (1) MAC OSX environment configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.