Mac OS X And Xcode 1.5 Project Setup Guide

From WxWiki

Jump to: navigation, search

This page describes how to build the Bombs demo using Xcode 1.5 on OS X. It assumes that you have already installed wxWidgets. In this example, wxWidgets has been installed using Darwin Ports in /opt/local. You should be able to use this guide as a template for importing other existing projects into Xcode, or for creating new projects from scratch.

  1. Open Xcode 1.5.
  2. Select File -> New Project -> Empty Project.
  3. Set the project name to "Bombs".
  4. Set the project directory to the wxWindows "demos/bombs" directory and click Finish.
  5. Choose Project -> New Target...
  6. Select Legacy -> Application and click Next.
  7. Set the Target Name to Bombs and click Finish.
  8. Open a terminal window and run the command "wx-config --cxxflags".
  9. Copy the ouput of the previous step.
  10. In Xcode Bombs project window, under the Groups & Files pane, select Targets -> Bombs.
  11. Select Project -> Edit Active Target "Bombs".
  12. In the Target:Bombs window select Settings -> Simple View -> GCC Compiler Settings.
  13. Paste the results of "wx-config --cxxflags" into the "Other C Compiler Flags" text box.
  14. Go back to the terminal and run the command "wx-config --libs".
  15. Copy the output of the previous step.
  16. Go back to Xcode and in the Target:Bombs window select Settings -> Simple View -> Linker Settings.
  17. Paste the results of "wx-config --libs" into the "Other Mach-O Linker Flags" text box.
  18. Select Project -> Add to Project...
  19. Add the files: bombs.cpp, bombs1.cpp, bombs.h, game.cpp, game.h, bombs.xpm
  20. In the project windows, select the Build and Go icon (hammer with a green arrow).
  21. The Bombs application should build and run.

You should be able to use this guide in importing and building your own wxWidgets applications. The key steps are:

  • creating a legacy application
  • setting the compiler and linker flags
Personal tools