openCV setup using Visual Studio Code - c++

I am using Microsoft Visual Studio Code with MinGw for setting up openCV using C++. A simple "Hello World" code executes successfully. But whenever I am trying to include an openCV library the compiler throws an error.
main.cpp:3:10: fatal error: opencv2/opencv.hpp: No such file or directory
3 | #include <opencv2/opencv.hpp>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
I searched for many solution on the internet but unfortunately none worked. Please help me in this regard as I am stuck with this issue for a long time.
c_cpp_properties.json file
launch.json file
task.json file
main.cpp code I am trying to execute

Related

Error: Cannot open include file: 'MQTTAsync.h': No such file or directory

OS -Windows 10 x64
Library mqtt
Microsoft Visual Studio Community 2017 Version 15.9.15
Programming Language - C++17
Installed paho-mqtt paho-mqttpp3 paho-mqttpp3[ssl] using vcpkg
I am creating a c++ program using mqtt.
But whenever I am using below given header
#include <mqtt/async_client.h>
It is giving following error
d:\vcpkg\installed\x64-windows\include\mqtt\async_client.h(27): fatal error C1083: Cannot open include file: 'MQTTAsync.h': No such file or directory
But MQTTAsync.h file is available on the given location
D:\vcpkg\installed\x64-windows\include\paho-mqtt
I had followed below link by creating new console project
https://github.com/Microsoft/vcpkg/issues/1848
Still issue is not getting resolved
Verify the correct name in your vcpkg-directory.
In my case that would be C:\Users\USERNAME\vcpkg\installed\x64-windows\include\paho-mqtt
Here you will see that the header file you are looking for is actually called MQTTAsync.h
To add it in your project you will have to change your inlcude to #include <paho-mqtt/MQTTAsync.h>

catastrophic error: cannot open source file "stdlib.h"

When compiling a C++ project, I have recently begun to see the following error:
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h(94): catastrophic error: cannot open source file "stdlib.h"
#include_next <stdlib.h>
This is very strange because the offending line #include_next <stdlib.h> is within the file /Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h meaning the file is somehow trying to include itself and failing.
This is a default system file so I don't understand why it should be broken suddenly. And advice would be greatly appreciated.
(Running on macOS Mojave with Intel icpc compiler)
This problem was eventually solved by running the macOS_SDK_headers_for_macOS_10.14.pkg installer located at /Library/Developer/CommandLineTools/Packages
The following command helped me on MacOSX Big Sur: export CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/

ESP8266WebServer.h, "functional: No such file or directory"

I tried to install library ESP8266WebServer into platformio IDE.
I got this error "functional: No such file or directory". A bit of research of "functional", http://www.cplusplus.com/reference/functional/
In file included from configMode.cpp:13:0:
.pioenvs/uno/ESP8266WebServer/ESP8266WebServer.h:27:22: fatal error: functional: No such file or directory
#include <functional>
^
compilation terminated.
In my case the very same error happened when I was trying to
#include <ESP8266WebServer.h>
in a .c file.
It should be .cpp in order to compile without errors.
I had this problem, but realised I had the wrong board set in the Arduino IDE. If you haven't installed the Arduino core for ESP8266 (https://github.com/esp8266/Arduino#installing-with-boards-manager) do so, then select the correct board from the Arduino IDE Tools menu.
I now have other compiler errors though.

How do I include GLFW 3.x, without errors?

I have downloaded GLFW 3.1.1(glfw-3.1.1.zip) to my computer.
I want to execute this code:
#include <GLFW/glfw3.h>
int main()
{
return 0;
}
In other words, I just want to be able to include GLFW in my code, so that I later on can open a context (for openGL use).
But I get this error message when running the code:
Error 1 error C1083: Cannot open include file: 'GLFW/glfw3.h': No such file or directory f:\opengl_coding\video_tut_test\video_tut_test\main.cpp 1 1 Video_tut_test
I know that there is a step that I haven't done, but I don't understand what this step is. Is it linking? I see this being talked a lot about in tutorials, but they never explain it properly.
How do I remove the error and make it possible to execute the above code?
I use Visual Studio Express 2013, on a Windows 8 machine.
I come from a Java background.

missing an existing c file. fatal error: g/protobuf-c/protobuf-c.h: No such file or directory

I'm working on an android app with native code (using JNI).
I try to build my c project in eclipse and get this error:
/Users/e/MyWorkspace/Client/src/android/java/jni/../../../protobuf/w/inbox.pb-c.h:6:42: fatal error: g/protobuf-c/protobuf-c.h: No such file or directory
this is inbox.pb-c.h:6:42:
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
#ifndef PROTOBUF_C_inbox_2eproto__INCLUDED
#define PROTOBUF_C_inbox_2eproto__INCLUDED
42: #include <g/protobuf-c/protobuf-c.h>
PROTOBUF_C_BEGIN_DECLS
searching with mac's index I see this file exist.
That's weird as it compliation stopped to work a few hour ago all the sudden without me touching this file.
how can I solve this?