Quick Start


First, install CodeLite and wxWidgets and run Codelite. The first time you do this, various dialogs will appear. These are self-explanatory; the most interesting one asks you to confirm the paths to search for header files, which CodeLite uses in Code Completion.

Once you've disposed of the dialogs, this is what you should see:

The Welcome page has a few 'urls' for Common Tasks. Click the one called Create New Workspace.


A simple dialog appears in which you supply a name for the workspace, and where you'd like to store it. By default this is your CodeLite configuration directory but you can change it to whatever you wish. Also by default, a separate new directory is created to hold the workspace, with the same name as it; this is a good idea if you're going to be creating multiple workspaces, but untick the checkbox if you don't want it to happen.



You now have an empty workspace. For it to be any use, you need to add one or more projects to it. There are other possible choices (see Different types of CodeLite project) but this tutorial will add a wxWidgets project. Click the toolbar button that looks like a piece of a jigsaw, and in the resulting menu select Create new wxWidgets project... The 'New wxWidgets Project' dialog will appear.


Again you need to choose a sensible name for the project, and decide where you want to put it (if your workspace will contain more than one project, separate subdirectories might be a good idea). You will normally choose the GUI application with Main Frame application type; Simple main with wxWidgets enabled is for a wx console application; or there are alternatives that use wxFormBuilder to create the gui.

Choose to build using pre-compiled headers if you wish. If you use MSWindows, you can also choose not to have a visible terminal window when running a GUI application.



In the second tab of the dialog, you can make choices about how your project should build (these can be changed in the future).
Unless you have a good reason not to, accept the default of creating a Unicode build. The other selections will depend on your platform and wxWidgets installation; in particular, if you installed wxWidgets in a non-standard place, fill in its path in the 'Prefix' field.

Click OK and you now have a wxWidgets project.



As you can see, you get code for a skeleton app inserted into the project. "All ready to build?". Well almost. You probably have a release wxWidgets build installed. If so, you need to change the Selected Configuration (Workspace View, top-left, just below the toolbar) from Debug to Release.

Then you're ready to build: click the Build Active Project tool, or from the menu select Build > Build project, or press F7. The compiler output is visible in the Output View. If all is well, you can run your new app using the Run Active Project tool (or Build > Run or Ctrl-F).


"But the app doesn't say Hello World! " Come on, even CodeLite can't do everything for you. If you want to display those magic words: open the file 'helloworld_frame.cpp' in the editor if you haven't already (double-click it in the Workspace View). In HelloworldFrame::Initialize change the line:

	GetStatusBar()->SetStatusText(wxT("Ready"));

to

	GetStatusBar()->SetStatusText(wxT("Hello World!"));

Rebuild, run it again, and the statusbar will show the famous message.



Home



Blix theme adapted by David Gilbert, powered by PmWiki