CB - GPS in C


Running the program

  1. obtain or compile a binary cb.exe (or cb) suitable for your system
  2. launch it
  3. click somewhere within the window, a menu should apper
  4. click on the menu Configuration and select the proper serial port parameters of your GPS port
  5. commit the configuration dialog with OK
  6. click on the menu Start, after few minutes the current coordinates should appear in the text boxes of the main window
  7. additionally select menu Record to GPX or Stop recording in order to create GPX files.
  8. click on the button Stop in order to stop reading GPS coordinates.

Compiling the program

MS Windows CE

Embedded Visual C++ 4
  1. Download embedded Visual C 4.0. Unfortunally Embdedded Visual C 4.0 (eVC4.exe) doesn't seem to be freely available anymore. You're lucky, if you downloaded it in 2008, else you must probably use Visual Studio.
  2. Adapt the script env_evc.cmd, set the environment variable EVC to the directory, where embedded Visual C has been installed or to the directory within Visual Studio, where the embedded tools reside.
  3. Presently the code compiles only for Arm. If you want to compile it for another architecture, change the variable TARGETCPU in the script. You'll also have to adapt makefile.vc, set another compiler (clmips.exe, clsh.exe, cl.exe) instead of clarm.exe and change the defines -DARM -D__ARM__ to -DSH, -D__SH__, -DMIPS etc.
  4. Run the script in the command prompt window.
  5. Run nmake -f makefile.evc4 in the same command prompt window, the executable cb.exe should be created as the result.
  6. Optional. Run nmake -f makefile.evc4 cb.CAB in order to create the cabinet installation file for Windows CE. You'll need cabwiz.exe for the cabinet creation, which is included for example in Windows Mobile 6 SDK (Windows Mobile 6 Professional SDK Refresh.msi) or in Visual Studio.

Visual Studio 8 (2005)

  1. Buy VS 8, at least Standard Edition
  2. Adapt the script env_ce_vs8.cmd to your installation
  3. nmake -f makefile_ce.vs8 or nmake -f makefile_cs.vs8 cb.CAB should do.


  1. Using Linux (cygwin also possible, though I didn't try it out)
  2. Download and install rpms from http://cegcc.sourceforge.net
  3. Put /opt/cegcc/bin to the search path
  4. Run make -f makefile.cegcc

MS Windows NT, 2k, XP, Vista etc.

On the desktop windows version you can either use Microsoft Visual C (Visual C 7.0, VCToolkit2003.exe, Visual C 8.0 from MS Visual Studio 2005, Microsoft Windows SDK with MS Visual Studio 2008) or mingw.

Visual C

  1. Install VCToolkit2003.exe (it was freely available on MS download pages until about 2007), MS Windows SDK or Visual Studio (MS Windows SDK and Visual Studio 2008 Express Edition are now available for download on MS download sites).
  2. Download and install MS Platform SDK. If you have Visual Studio or MS Windows SDK, the SDK is already there.
  3. Adapt the script env_vc.cmd, it is presently trimmed for MS Windows SDK
  4. Run the script in a command prompt window.
  5. Run nmake -f makefile.vc in the same command prompt window, the executable cb.exe should be created as the result.


  1. Download and install Mingw from http://www.mingw.org. Refer to http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite for how to download and install it. You'll need the gcc compiler, binutils, win32 api and GNU make.
  2. Adapt the script env_mingw.cmd. Set the environment variable MINGW to the directory, where the mingw packages above have been installed.
  3. Run the script env_mingw.cmd in a command prompt window.
  4. Run make -f makefile.mingw in the same command prompt window, the executable cb.exe shout be created as the result.

UNIX with wine

The code is generally platform independend (as it can be :-), with the huge exception of the GUI. The GUI (cbgui.c) has been implemented using raw Win32 API because it seems presently to be the only way for porting the same program under Windows CE, Windows and UNIX. An alternative could be using wxWidgets, but unfortunally I could not succeed to compile it for Windows CE (but theoretically it should be possible, see also http://wiki.wxwidgets.org/Developers_Notebook-WxWinCECompiling).
  1. Install wine, incl. the libraries and headers. In the case of Opensuse Linux the packages wine and wine-debug have to be installed.
  2. call make -f makefile.wine.
  3. all code parts are compiled using winegcc, though this is really necessary only for cbgui.c. The remaining modules: cbthr.c, cbser.c and cbgps.c can be easyly compiled using the default compiler: gcc, cc etc.

Creating documentation

Obtain doxygen from http://www.doxygen.org, install it and set search path to the directory, where doxygen binary is located. Call
  1. make -f makefile.mingw doc
  2. make -f makefile.wine doc
  3. nmake -f makefile.vc doc

The documentation will be created in the directory doc.

Using parts of the program as libraries

See documentation in cbser.h and cbgps.h for examples for how to embed the code in your own projects.
Generated on Thu Feb 12 11:09:26 2009 for cb by  doxygen 1.4.7