Difference between revisions of "Your First Compile - Windows"
(Created page with "This guide will help you set up your first compile under windows. We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can set up...") |
|||
Line 7: | Line 7: | ||
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li> | <li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li> | ||
</ul> | </ul> | ||
+ | |||
== Getting the bits == | == Getting the bits == |
Revision as of 03:13, 30 September 2014
This guide will help you set up your first compile under windows. We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can set up any of a number of development IDE's.
Some IDE's worth looking at:
- Code::Blocks - very easy to set up and use
- Eclipse - The standard for cross platform development. Can be tricky for normal windows developers
- Microsoft Development Studio - The gold standard but pricey and untested with uGFX
Contents
Getting the bits
You will need to download uGFX. See Getting Started for how to get the uGFX source code. You will need to get cygwin [1]. You can either get the 32 bit or 64 bit installer.
Installing Cygwin
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:
- make
- mingw-binutils
- mingw-gcc-core
- mingw-w32api
Set Up Your Folder Structure
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:
- uGFX
- TestProject
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.
Setting Your Environment
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.
PATH=C:\cygwin\bin;%PATH%
or
PATH=C:\cygwin64\bin;%PATH%
for a 64 bit version of cygwin.
The First Build
Just type "make" to now make your first demo. To run it after building:
.build/TestProject.exe
You can then use "make clean" to clean up all the object files etc that were created.
What's next
- Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.
- Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.
- You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.