I’m trying to use some sample code to try out the Lynx light sensing module. I don’t recall exactly when and, at the moment, I can’t find the source file but I downloaded a bunch of samples in a file called Tests.zip. I’m trying to compile the LightSense.sln (Main.cpp included for reference)
When I try to build the solution, I get a series of errors. The error is “IntelliSense: cannot open source file 'Gadgeteering.h”. I have one error for each .h file. These are errors, not warnings.
When I right-click on on the include statements and select Open Document, the IDE has no problem opening the .h files. To get this far, I copied all the header files from the GHI folder in Program Files into my solution folder; probably not the best solution but I’m a C# guy with some experience in C++ so I’m trying.
How do I fix the above errors so I can build this solution? Do I need to reference a .lib file? If so, how do I do that? Visual Studio 2013, Windows 8.1…
I not much experience with the gadgeteering SDK so far, but it’s definitely not an lib problem.
You should look for the include path.
#inlucde <…> (with angle brackets means to look in one/all the include path for the file.
Gadgeteering.h, Mainboards/… and Modules/… is all under “\Documents\Arduino\libraries\Gadgeteering\src” (if Gadgeteering SDK is installed correctly.
My one and only MedusaMini project is located in “\Documents\Arduino<prjName>” and does not have any problems to find these files.
In the current release of the Gadgeteering SDK, the tests inside the Tests.zip folder are setup to work with our local development setup. Changing the paths as scardinale did will allow them to work. As for the linker error, the libraries we ship are built to work with the v110 platform toolset. Since we currently only ship static libraries, your project must use the same toolset to link properly. Visual Studio 2013 defaults to the v120 toolset which is _MSC_VER 1800. v110 is _MSC_VER 1700. To change the toolset your project uses, right click the project in the Solution Explorer, click properties, then under Configuration Properties > General, change Platform Toolset to Visual Studio 2012 (v110) and you should be able to compile.