OpenCV Include error "Cannot open source file" - c++

I am new in OpenCV. I had install Visual Studio 2015 and OpenCV3.1.
I had included all the dependencieas and include file location.
But I am getting error:
cannot open source file"opencv2/imgproc/imgproc.hpp"
cannot open source file"opencv2/imgcodecs.hpp"
cannot open source file"opencv2/highgui/highgui.hpp"
Anyone can help whats is the problem?

In the additional Include directories the path should be something like .. 'C:\OpenCV-3.0.0\opencv\build\include' once whether it is
#include "opencv2/imgcodecs.hpp" or #include "opencv2/imgcodecs/imgcodecs.hpp" because in the version i am using header file inside the folder imgcodecs.

Related

gtk/gtk.h: No such file or directory, on Windows, using VS code

I try to compile a cpp file with this header:
#include <stdlib.h>
#include <gtk/gtk.h>
I work with MSYS2, so both the compiler and the gtk library are installed through it. The cpp compiler path is:
D:\msys\usr\bin\cpp.exe
and here is the VS code include path additions, which I supplied to the IntelliSense Configurations page under "include path":
D:\msys\mingw64\include\gtk-2.0\**
D:\msys\mingw64\include\**
D:\msys\mingw64\lib\**
D:\msys\usr\include\**
and I have gtk etc. in the include folder. I actually installed three different versions of gtk, 2-4.
Before I added them to the include path, I got an error like "cannot open source file", and after adding them I get the
fatal error: gtk/gtk.h: No such file or directory
error. gtk/gtk.h is located just inside gtk-2.0. What am I doing wrong?
Thanks a lot.

VS Code cannot open iostream

Why is my VS Code giving the error of updating #include path and what does it mean? It writes that it cannot open iostream source file. I have successfully installed all extensions and included path too.

Cannot open source file "glew.h" and "freeglut.h"

I am trying to run a project and I have to first include glew.h and freeglut.h. I open Visual Studio, go to Project - > Properties ->c++->General -> Additional Include Directories I write "C:\Users\malvi\Desktop\DevOgl\Common\glew\include\GL;C:\Users\malvi\Desktop\DevOgl\Common\freeglut\include\GL", which are the absolute paths of the glew.h and freeglut.h files, but when I try to run it, it says E1696 "cannot open source file glew.h" and E1696 "cannot open source file freeglut.h". At solution explorer I have algebra.cpp,main.cpp and mesh.cpp under source files and algebra.h,mesh.h and shaders.h under header files.
Any idea what might be going wrong? Thank you!

C++ project is not finding its header files (visual studio)

I have not used C++ in visual studio in a lonnng lonnng time so probably this is a basic question but I would like some help.
I am opening someone else C++ code and the first thing I notice is that it is not recognizing its includes.
For example I have a main.cpp that has
#include "stdafx.h"
#include "myheader.h"
this cpp file is inside a "source" folder and those header files are under a "headers" folder.
I got an error "cannot open source file "stdafx.h" and "cannot open source file "myheader.h"
It is been ages I haven't touched C++ in visual studio. What configuration I should do to fix this?
if source and headers folders are in same level in folder structure you can use
#include "..\headers\myheader.h"
Similarly locate your stdafx.h and add the relative path to the .cpp file.

Unable to include Magick++.h for image processing: "no such file or directory"

I'm setting up a c++ visual studio project to use ImageMagick's api, Magick++, for image processing. However, when I try to include <Magick++.h> in the only cpp file in the whole solution/project, I encounter this error:
fatal error C1083: Cannot open include file: 'Magick++.h': No such file or directory
I tried right-clicking Magick++.h in my code and pressing open document <Magick++.h>. This lead to an error message, which says the file is not found in current source file's directory or in build system paths. However, in the error message, the Build System Path clearly says the path to the include directory.
I have:
added the include directory of ImageMagick-7.0.9-Q16 in the project's properties->C/C++
->Additional Include Directories.
added the lib directory of ImageMagick-7.0.9-Q16 in the project's properties->Linker->Additional Library Directories
added CORE_RL_Magick++_.lib, CORE_RL_MagickCore_.lib, and CORE_RL_MagickWand_.lib in the project's properties->Linker->Additional Dependencies
Made sure everything is x64
Set the configuration to release
I somehow made Magick+++_demo project, the one that comes with magick++, work after tinkering with the settings. However, I cannot make other projects/solutions work. I have checked the settings of the demo project and tried to replicate it in my project where appropriate, but I cannot make my own project work.
this is the only code:
#include "pch.h"
#include <Magick++.h>
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
}
I have been googling and trying to make this work for the last 6 hours. Any help is hugely appreciated.