How to combine multiple sensors into one project with separate drivers? - c++

I am creating an application that requires a Ximea camera and a sensor which is connected to a driver. Both are C++ compatible. The problem is that the Ximea camera only builds in x86 on Visual Studio and the sensor builds on x64. I would like to run both from the same project, and I believe that I need to use MSBuild or some sort of Batch Build to configure both so that they can both run at the same time. I essentially want to take images from the camera to steer the sensor, so they both need to be running at the same time.
Here is a link to the API I am using for the camera.
(This is my first time working heavily in C++ so any advice/references/resources would be great!)

I would like to run both from the same project, and I believe that I
need to use MSBuild or some sort of Batch Build to configure both so
that they can both run at the same time.
Run and build means different things, you can use msbuild or batch scripts to build Ximea camera project in X86 and the sensor project in X64 when you build the whole solution.
In VS you can right-click Solution in Solution Explorer=>Configuration Manager to control this behavior. See:
Then when you choose Solution Platform x86, it actually builds the project A and B in X64, and C in X86. This is what msbuild can do for you. But I can't make sure if there will be compatibility issue when you run it.

Related

Build Library for Multiple architectures through command prompt, Atmel Studio

I have a library that is used for multiple different projects that use different chip architectures (i.e. atxmega32, atxmega64, atxmega128). Within Atmel Studio 7, I can change the Current Device of the library to be associated with any of these chips to build the specific project, but I do not know how to do this without the IDE.
I am hoping to have the single instance of the library, but build it for a specified architecture in the command prompt (doing this if possible since it seems simple: https://microchip.my.site.com/s/article/Building-an-Atmel-Studio-solution-via-commandline). I thought this might need to happen through using the /projectconfig <projectconfig_file> but I do not know how to use/setup the projectconfig file to do that.
The ultimate end goal is to have a Docker container that will be able to run a build without accessing to the IDE.

Raspberry Pi crashes when building OpenFrameWorks project in Eclipse CDT

I'm working on a Raspberry Pi 3 with OS Raspbian Jessie. I'm using Eclipse CDT (for C/C++) and am trying to learn about OpenFrameWorks:
http://openframeworks.cc/
I installed everything according to the guides and imported everything to Eclipse. I thought it seemed to work out, but when I try to run some test-code I get the error "Unable to launch, binary not found." I look it up and find a potential solution, that I have to build the actual project first.
This is my problem, when I try to build the project Eclipse gets to about 20% and then the entire Raspberry freezes, forcing me to force a restart. How can I continue from here on out? I don't know if I still should try to build the project through Eclipse or if there is another way to actually run some test code for OpenFrameWorks.
I don't know if this is the best place to ask about this, but I'm thankful for all answers.
Eclipse is super slow on Raspberry Pi.
I recommend using the provided setup scripts to install dependencies. After you compile OF, use make files to compile projects.
In terms of editing code, I recommend using a light weight text editor (geany for example). I've tried CodeBlocks and Qt Creator, which are faster/less resource intensive than eclipse, but still pretty heavy for a system with limited resources.
Another option is to combine your computer the RPi:
Use projectGenerator to generate a project for both Raspberry Pi and your computer/IDE
Edit/test/iterate on your computer
When ready to run on RPi, sync the project using your preferred method(e.g. SSH/SFTP/git/etc.), then use make -j4(to use all 4 cores) in the RPi project folder.
The pro is you the quick compile/feedback times you're used to on your computer.
The con is this method won't work for RPi specific code (e.g. accessing GPIO, PiCamera, etc.)
Another option is to setup cross compilation, but getting everything ready is a bit laborious. (Although, once it's done, it saves time on the long run).

Working with Stellarium API

I am having trouble integrating the Stellarium API with any IDE. I have tried Visual Studio 2013 and Qt Creator, and both seem to not recognize anything that has to do with Stellarium.
How do I get to a point where I can use all the classes and functions found in the Stellarium Developers Documentation and integrate them into my code?
The program I am trying to create is one which goes over a given list of dates and locations (on Earth) to output when and where a given object is seen high enough in the sky (Altitude of 30° minimum), during the night and with no moon interruption so that a successful observation could be made. For that, I need Stellarium and its functions.
Any ideas?
What I've done that worked was use a cmake GUI application to prepare the build, you just need to supply its dependencies and click in configure and generate, remembering to select the compiler from visual studio, like msvc 20.. 64 bits with opengl support. After that a visual studio project will be generated in the folder that you choose. When you open this project, to compile you just need to build the stellarium item on the list and after that, the install item. When it be done, just go to source's code folder and use the file install.iss, you must have installed the inno setup compiler.

Coping with several Windows SDK versions on build server

We have a TeamCity build server with a couple of agents set up to build code on check in for several c++ projects. Now, we've run into some problems regarding handling dependencies on Windows SDK since
It's to large to check-in and still be able to work with the source
smoothly.
Several can't be installed at the same time without problems.
The easiest way to set up TeamCity agents is to just install the Windows SDK. However, installing two versions the Windows SDK is problematic since it seems to overwrite registry entries of previous installations. Another approach is to cherry-pick files from the installation and put it on an rsync-server or the like, but the Windows SDK installer seems to modify Visual Studio binaries, etc so that does not feel good either. I've also checked with microsoft and they strongly suggested against cherry-picking files from the SDK install.
How have you set up your c++ projects on TeamCity and what would you suggest in our situation?
If you make sure the versions of the SDK are installed in the same location on each machine that you use (both developer and build machine) then you can add a step to the start of your build scripts which sets the current SDK for use. You can do this either:
Using the registry settings (if you have only one build going at any time)
Using environment variables, which you reference in your project files for lib, bin etc.
I've seen this work pretty well before, although we we weren't using TeamCity.

wxWidgets running on other machine

I created application which uses wxWidgets library using visual studio 2008. Now I would like to create version which may be run on other machine.
Because right now when I want to run It on another machine there is an error:
the application failed to start because its side-by-side configuration is incorrect.
What can I do to make It work ?
The Event Viewer should have a record showing what DLL was being searched for, what version of that DLL if found in the SxS cache, and what version it was looking for but couldn't find. You'll then want to (for example) include the correct version of that DLL to be installed with your program. Alternatively, just link to virtually everything statically -- it'll make your executable a lot bigger, but eliminate a lot of problems like this relatively painlessly.