Error running Opencv sample code - c++

I am starting with OpenCV on my new laptop, but there are some errors. I followed all the steps mentioned in the OpenCV tutorials in doc directory. But the sample code just does not work. This is the error:
">c:\users\ankit\documents\visual studio 2010\projects\test\test\test.cpp(7):
fatal error C1083: Cannot open include file: 'opencv2/imgproc/imgproc.hpp':
No such file or directory
1>
1>Build FAILED."
I am working on Win7 64 bit machine. I have already included Additional directories and libraries in Property Page. Still it gives me this error. Help.

You obviously entered a wrong include directory. Navigate to included directory and make sure that it contains file opencv2/imgproc/imgproc.hpp.
Update:
Here's error doc. See all the causes.
Update #2:
About your new issue.

Related

Ran into a "'cl.exe' is not recognized" and "c1xx: fatal error C1083: Cannot open source file: No such file or directory" error

I encountered both of these errors when going through the Configure VS Code for Microsoft C++ article, here.
I had VS Code, got the C++ extension, used Developer Command Prompt(Run as Admin), made the right directories and projects using these commands:
mkdir projects
cd projects
mkdir helloworld
cd helloworld
code .
Which opened VS Code and I pasted in the helloworld code correctly and created the tasks.json file. But when I went running Build Task I got this error:
helloworld.cppc1xx: fatal error C1083: Cannot open source file:
'c:\Windows\System32\projects\helloworld\helloworld.cpp': No such file
or directory
And when I tried again today I got a completely different error:
'cl.exe' is not recognized as an internal or external command,operable
program or batch file.
I've tried looking for questions with similar errors to mine but none really seemed applicable. Any idea as to what I'm doing wrong?
You made your projects folder inside c:\Windows\System32\
This folder is accessible only with admin rights.
I am guessing that VS Code run build task without admin rights which causes the problem.
Try creating your projects folder in User folder.

New to LibVLC - Trying out libVLC on VS2010

I downloaded vlc-2.2.4-win32.7z and extracted the files. I created an empty project in VS2010 and create a cpp file using the code I found on https://wiki.videolan.org/LibVLC_Tutorial/
On VS2010 project property, I added the include file folder and added Linker library folder and libvlc.lib, libvlccore.lib, vlc.lib, vlccore.lib to additional dependencies.
I got this build error --> D:\VLC\vlc-2.2.4\sdk\lib\vlccore.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x16.
I have re-downloaded the file and still having the same error. Is there anything that I had done wrong .
Thanks,
Alex
For some reasons, the later versions do not work. I downloaded 2.1.3 and it worked.

Compile and Execute QxORM qxBlog example

I'm actually in a project in which I use Qt and I need to use an ORM. I found QxORM. In the process of getting started with this ORM, I need to be able to compile and execute the qxBlog example provided with it. I have thoroughly followed
the QxORM installation tutorial : http://www.qxorm.com/qxorm_en/tutorial_3.html
the qxBlog example test tutorial http://www.qxorm.com/qxorm_en/tutorial_1.html
But when I execute the project (qxBlog) with QtCreator, I get this error
C:\Users\HP\dev\libraries\qxorm\QxOrm_1.4.2\test\qxBlog\include\precompiled.h:4: erreur : C1083: Cannot open include file: 'QxOrm.h': No such file or directory
Following this error, I compiled the QxORM library with all its dependencies to get the qxormd.dll and put either in bin or lib folder (that I created) but it didn't work.
Can anyone help me with this issue?
Thanks in advance!
I have changed the "#include " line in precompiled.h to "#include <../../include/QxOrm.h>" (relative path to QxOrm.h file) but I still get a similar error because of the includes in that file (QxOrm.h).
C:\Users\HP\dev\libraries\qxorm\QxOrm_1.4.2\include\QxOrm.h:58: erreur : C1083: Cannot open include file: 'QxPrecompiled.h': No such file or directory
I don't want to put the QxORM library in the same folder as the project. How can I successfully include Qxorm.h with all its dependencies without putting the entire library in the same folder as my project ?
Thanks in advance !
Thanks for you answer. I have added an include path in my .pro file. I get no such previous errors. Nevertheless, I get this error
"LNK1104: cannot open file 'QxOrmd.lib'"
Can anyone help me with this?
Thanks in advance.
I found an answer to my question with #drescherjm help.
All I had to do was to add an include path to my .pro file. I did it by adding the following line :
INCLUDEPATH += ../../../QxOrm/include/

CUDA error MSB3191

I tried to do the two new steps manually in my older project (CUDA Link Error (Lib to Dll)) to get my CUDA kernel running (just added the structure to the Lib part of the project). The steps are:
1: Project's 'Build Customization' to use CUDA 7.0(.targets, .props)
2: TestKernel.cu I've changed it's type to CUDA C/C++ in the Class Property Page.
Now I'm getting the following error message from CUDA 7.0.targets:
Error 1 error MSB3191: Unable to create directory
"SourceLib.dir\Debug\C:\Users\Matthieu\Desktop\Project\src\SourceLib\Helpers\".
The given path's format is not supported. C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA
7.0.targets 412 9 SourceLib
I've searched for a solution but I can't find any. Everyone is talking about this part "SourceLib.dir\Debug\C:\Users.......", which obviously looks wrong, but I can't find the setting in Visual Studio or CMake. Where can I adjust this?
It's similar to this question (CUDA 6.5: error MSB3191 Unable to create directory and LNK2001 Unresolved External symbol), but I can't fix it by copying the .cu file.
If I don't set the .targets file it won't build. I'll get the older error. Any help?
And alternative for getting the setup running using Cmake is also welcome :)
Thx!
The issue was that the CMake file was filling "SourceLib.dir\Debug" into the Intermediate Directory property (Project Properties -> General). Deleting it resolved the issue with the CUDA 7.0 target

fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory

I would like to compile a c++ file as a mex file in MATLAB namely: "mexLasso.cpp".
These are the steps I take and I get the following error. What is the problem?
1. Put the files "mexLasso.cpp" and "mexutils.h" in a folder.
2. Set the compiler:
mex -setup C++
I recieve:
MEX configured to use 'Microsoft Visual C++ 2013 Professional' for C++ language compilation.
3. Run the command:
mex C:\...\mexLasso.cpp
I recieve the following error:
Error using mex
mexLasso.cpp
C:\...\mexLasso.cpp(33) : fatal error C1083: Cannot
open include file: 'mexutils.h': No such file or directory
Can somebody help us what we are missing?
From the mex command line tool reference, there is an argument for adding include paths:
-Ipathname Adds pathname to the list of folders to search for #include files.
Do not add a space between I and pathname.
Like this:
mex -v -IC:\path\to\mexutils_h\ mexLasso.cpp
Note that with -I you are not specifying the header, you are specifying a path containing one or more header files.
Thanks for your comments. I think the besy way to solve my problem is to install SPAMS in my machine and successfully compile it. I have posted the steps I take in this post :
How to install SPAMS toolbox in Matlab 2014b under windows 8.1
Can I have your opinion there. Sorry for duplicated message, only for relevancy and importance of the discussed topic.
Many thanks.