9. Using Yocto-GPS with C++C++ is not the simplest language to master. However, if you take care to limit yourself to its essentialfunctionalities, this language can very well be used for short programs quickly coded, and it has theadvantage of being easily ported from one operating system to another. Under Windows, all theexamples and the project models are tested with Microsoft Visual Studio 2010 Express, freelyavailable on the Microsoft web site1. Under Mac OS X, all the examples and project models aretested with XCode 4, available on the App Store. Moreover, under Max OS X and under Linux, youcan compile the examples using a command line with GCC using the provided GNUmakefile. Inthe same manner under Windows, a Makefile allows you to compile examples using a commandline, fully knowing the compilation and linking arguments.Yoctopuce C++ libraries2 are integrally provided as source files. A section of the low-level library iswritten in pure C, but you should not need to interact directly with it: everything was done to ensurethe simplest possible interaction from C++. The library is naturally also available as binary files, sothat you can link it directly if you prefer.You will soon notice that the C++ API defines many functions which return objects. You do not needto deallocate these objects yourself, the API does it automatically at the end of the application.In order to keep them simple, all the examples provided in this documentation are consoleapplications. Naturally, the libraries function in a strictly identical manner if you integrate them in anapplication with a graphical interface. You will find in the last section of this chapter all the informationneeded to create a wholly new project linked with the Yoctopuce libraries.9.1. Control of the Latitude functionA few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a C++ code snipplet touse the Latitude function.#include "yocto_api.h"#include "yocto_latitude.h"[...]String errmsg;YLatitude *latitude;// Get access to your device, connected locally on USB for instanceyRegisterHub("usb", errmsg);latitude = yFindLatitude("YGNSSMK1-123456.latitude");1 http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express2 www.yoctopuce.com/EN/libraries.phpwww.yoctopuce.com 59