Using Cmake to generate C++ Visual Studio project - c++

So this is a tricky problem I have. I have an open source object tracking algorithm that runs well on Windows using Visual Studios 2013. Now, I have another algorithm using stereo vision that output two images, but this is done in Ubuntu using Cmake. My goal is to output this two images and pass them through the object tracking code.
What I want first is to make the algorithm that runs in Windows, work using cmake in Ubuntu. For this I guess I will need a CMakelists.txt for the path files. Might this be possible? The code do object color tracking using a monocamera connected to the PC. What should I do?
Any suggestion will be appreciated. Thanks!

Related

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

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.

CUDA opencv building fails - missing file that is actually there

I am trying to do the following: getting to work
CUDA 9.1 with
openCV 3.4.2 and
Visual Studio Enterprise 2015 (v 14.0 Update 3) on
Windows 7 Enterprise x64 SP 1 using
CMake 3.12.0
and also searching for others with the same problem - no success there.
I have worked through this tutorial on getting the software to work together. I do not intend to use Intel MKL and TBB.
I have succeeded in
installing CUDA
generating the Makefiles for openCV with CMake, and having the CUDA libraries included without any mistakes (barring the download of optional stuff, as the PC I am working on is to stay off the internet)
generating the .sln solution file for building openCV in Visual Studio
The problem is in the next step - building openCV. The compiler claims that "opencv2/opencv_modules.hpp" cannot be opened by gpu_mat_cu when it tries to build opencv_world. The thing is that the include path works according to Visual Studio - it detects the right file in the gpu_mat.cu. The project (opencv_world) has the right directory in its include paths as static path.
I am new to Visual Studio (I worked in Linux with QT, CUDA and openCV before), so I am not too sure I am not missing some kind of settings I should change.
The opencv_world.hpp only consists of #define instructions. I have tried deleting the include of opencv_world.hpp and instead just defining the parameter in gpu_mat.cu itself, but if I do, the next include (that, again, VS finds the path to without problems) is not resolved.
I guess there is something obvious I am missing, but I don't seem to be able to resolve this issue, so thanks in advance for your help.
Cr4sh
P.S.: The files CMake wanted to download for openCV and failed at (obviously; no internet connection) are: opencv_ffmpeg.dll, opencv_ffmped64.dll, ffmpeg_version.cmake, ippicv_2017u3_win_intel64_general_20180518.zip, res10_300x300_ssd_iter_140000_fp16.caffemodel and opencv_face_detector_uint8.pb
I'd add the CMakeCache.txt file in a spoiler tag, but it has too many characters. If you think it would help, let me know and I'll upload it somewhere.
I got the solution, just in case someone stumbles over the same problem: it's the most simple thing that everybody knows until they don't - my include path contained a white space that apparently somewhere was treated as a String divider for whatever interprets that path.

How/can/Is it possible to run/open/link/develop a DirectX project using CLion?

I've recently installed CLion in the hopes that I can start using this over visual studios and it seems to be decent for at least regular c++ projects etc but I am wondering how and if I can use it to develop directx code. In visual studios you simply have the directx folder along side your project like so
C:/myproject/main.cpp
C:/DirectXTK/directxfiles etc
and you can import and link the files by either dragging them onto the project or using the import files and it will link them up etc is there anyway I can do this using CLion? for a fairly new programmer it's super confusing. I tried googling adding libraries and such but I struggled to understand most of what exactly was said, could someone explain it to me please? and if you can will it run just as it would run in visual studio?(and would it run on a mac)
My reason for wanting to use CLion is simply because I'd like to be able to run CLion on my mac and be able to run and test without having to use my current solution which is parallels/bootcamp/running windows then visual studios etc. Unless someone has a better idea?
Thanks in advance if someone can help!
There is no DirectX on Mac OS X, OS X uses OpenGL instead.
So using CLion would not solve your problem.

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.

Kinect for windows program in VisualC++ can't find freeglut.dll even though freeglut has been installed. Why?

This is my first post to this site. I'm hoping that someone can help me out.
I am doing some work with the Microsoft Kinect for Windows and I am trying to set up visual studio to use GLUT. The code builds successfully, but I keep getting the following error message when I try to run the program in Visual Studio:
The program can't start because freeglut.dll is missing from your
computer. Try reinstalling the program to fix this problem.
I have installed the Microsoft SDK and Developer Toolkit for the Kinect and I am using Visual Sutdio 2010. I followed the instructions on this tutorial, Kinect SDK C++, in order to set everything up, including downloading the freeglut 2.8.1 MSVC Package and copying the appropriate files into various folders as per the tutorial instructions. I have tried renaming freeglut.dll to glut32.dll as the tutorial suggests and leaving it unchanged.
The code I'm using is the sample code from the second page of the tutorial. I've also tried the source code provided in this tutorial: Programming KINECT in C++ and OpenGL — Color Stream Rendering. Both build fine, but yield the same error when run.
I tried deleting the freeGLUT files and replacing them, rearranging their folder structure in the SDK folders (and changing the corresponding filepaths in my project properties) as well as following the solution presented in this post: compiled program cannot find freeglut.dll. So far nothing is working and that last solution actually caused the both codes I'm using to fail building with error MSB3073.
I would appreciate any insight you might have into this issue.
Thank you!