CB - GPS in C
Embedded Visual C++ 4
- obtain or compile a binary cb.exe (or cb) suitable for your system
- launch it
- click somewhere within the window, a menu should apper
- click on the menu Configuration and select the proper serial port parameters of your GPS port
- commit the configuration dialog with OK
- click on the menu Start, after few minutes the current coordinates should appear in the text boxes of the main window
- additionally select menu Record to GPX or Stop recording in order to create GPX files.
- click on the button Stop in order to stop reading GPS coordinates.
- 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.
- 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.
- 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.
- Run the script in the command prompt window.
- Run nmake -f makefile.evc4 in the same command prompt window, the executable cb.exe should be created as the result.
- 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)
- Buy VS 8, at least Standard Edition
- Adapt the script env_ce_vs8.cmd to your installation
- nmake -f makefile_ce.vs8 or nmake -f makefile_cs.vs8 cb.CAB should do.
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.
- Using Linux (cygwin also possible, though I didn't try it out)
- Download and install rpms from http://cegcc.sourceforge.net
- Put /opt/cegcc/bin to the search path
- Run make -f makefile.cegcc
- 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).
- Download and install MS Platform SDK. If you have Visual Studio or MS Windows SDK, the SDK is already there.
- Adapt the script env_vc.cmd, it is presently trimmed for MS Windows SDK
- Run the script in a command prompt window.
- Run nmake -f makefile.vc in the same command prompt window, the executable cb.exe should be created as the result.
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).
- 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.
- Adapt the script env_mingw.cmd. Set the environment variable MINGW to the directory, where the mingw packages above have been installed.
- Run the script env_mingw.cmd in a command prompt window.
- Run make -f makefile.mingw in the same command prompt window, the executable cb.exe shout be created as the result.
Obtain doxygen from http://www.doxygen.org, install it and set search path to the directory, where doxygen binary is located. Call
- Install wine, incl. the libraries and headers. In the case of Opensuse Linux the packages wine and wine-debug have to be installed.
- call make -f makefile.wine.
- 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.
- make -f makefile.mingw doc
- make -f makefile.wine doc
- nmake -f makefile.vc doc
The documentation will be created in the directory doc.
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