While compiling my rather simple project I get an error that I'm unable to resolve. The included libraries are:
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
And the error that HTTP_GET was not declared in this scope concerns the following line :
message += (server.method() == HTTP_GET) ? "GET" : "POST";
I'm using an ESP32 module produced by AZDelivery, the board is selected and other simple projects (like blinking the internal LED) word like a charm.
Any ideas how to solve this would be appreciated
EDIT: below is the full error message as thrown in Arduino IDE (on macos)
Users/yannickgery/Documents/Arduino/controlservo/controlservo.ino: In function 'void handleNotFound()':
controlservo:156:34: error: 'HTTP_GET' was not declared in this scope
message += (server.method() == HTTP_GET) ? "GET" : "POST";
^
/Users/yannickgery/Documents/Arduino/controlservo/controlservo.ino: In function 'void setup()':
controlservo:206:23: error: 'HTTP_GET' was not declared in this scope
server.on("/motor", HTTP_GET, motorControl);
^
Multiple libraries were found for "WiFi.h"
Used: /Users/yannickgery/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
exit status 1
'HTTP_GET' was not declared in this scope
Assuming you're using the HTTP methods defined in this arduino-esp32 library then perhaps you have a very old version of it? Try including this file directly with #include "HTTP_Method.h", see if it surfaces #include errors (in which case you have a very old version) or fixes your problem (maybe you have several files of the same name in the include path?).
Related
I wrote this code:
#include <Keyboard.h>
void setup() {
Keyboard.begin();
Keyboard.print("Hello!");
}
And Iam getting the error
C:\Users\nobody\sketch_feb12a\sketch_feb12a.ino: In function 'void setup()':
C:\Users\nobody\sketch_feb12a\sketch_feb12a.ino:4:3: error: 'Keyboard' was not declared in this scope
Keyboard.begin();
^~~~~~~~
exit status 1
Compilation error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
I tried installing Keyboard.h from a zip and from the Library manager.
What do I have to change?
If you're trying this on a board that supports emulating USB devices, such as the Teensy, then you need to select keyboard option for USB Type:
Tools > USB Type > Keyboard
This library does not work for the Arduino Uno or similar boards.
Have you use the board like Leonardo? If you try to compile code with keyboard for the board which doesn't support HID interface, you will get this error.
Trying to build project on newly installed Qt that runs on Centos 64 bit. Got error:
/home/me/pro/LoggingCategories.h:4: error: QLoggingCategory.h: No such file or directory
#include <QLoggingCategory.h>
^
Why it is missing? I suppose it should be installed as default. How to fix error?
UPD
Got the same error after changing #include <QLoggingCategory.h> to #include <QLoggingCategory>
/home/me/pro/LoggingCategories.h:4: error: QLoggingCategory: No such file or directory
#include <QLoggingCategory>
^
I'm trying to test a library for an DHT22 "Temperature Sensor", but I got an error while including an internal arduino library from the DHT.cpp file
I got this error:
C:\Program Files (x86)\Arduino\libraries\DHT\DHT22.cpp:56:20:
fatal error: avr/io.h: No such file or directory #include <avr/io.h>
In the DHT22.cpp, this is the the block of error
extern "C" {
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
}
I got in the conclusion that the library is not finding the avr folder which is
in C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr I checked another built-in library servo.cpp and this is the include part
#include <avr/interrupt.h>
#include <Arduino.h>
but the last one works without errors, my question is why the DHT library is not importing the required files and the servo does ?
It looks like you are using some old version of the library (from 2012).
The latest version, which does not contain the problematic "extern" block, can be found here:
https://github.com/adafruit/DHT-sensor-library
(The default example works nicely with my Arduino Nano v3.0 and DHT22 sensor)
I am trying to compile this. I am using the AMD SDK. I am using the header files that come with the aforementioned SDK and they are located in:
C:\Program Files (x86)\AMD APP\include\CL
The tutorial states:
Header files
Just like any other external API used in C++, you must include a header file when using the OpenCLâ„¢ API. Usually, this is in the directory CL within the primary include directory. For the C++ bindings we have (replace the straight C API with cl.h):
I found that last bit a little confusing. I am using both .h and .hpp
#include <CL/cl.h> when this is used it will compile the checkErr function
#include <CL/cl.hpp> when this is used it gives me access to the cl namespace
When I try to compile this code it fails with:
'clUnloadCompiler': was declared deprecated
ADDITIONAL DETAILS (after removing #include <CL/c.h>)
It now gives the following list of errors:
error C4996: Error 2 error LNK2019: unresolved external symbol _clReleaseCommandQueue#4 referenced in function "public: static int __cdecl cl::detail::ReferenceHandler<struct _cl_command_queue *>::release(struct _cl_command_queue *)" (?release#?$ReferenceHandler#PAU_cl_command_queue###detail#cl##SAHPAU_cl_command_queue###Z)
error LNK2019: unresolved external symbol _clReleaseContext#4 referenced in function "public: static int __cdecl cl::detail::ReferenceHandler<struct _cl_context *>::release(struct _cl_context *)" (?release#?$ReferenceHandler#PAU_cl_context###detail#cl##SAHPAU_cl_context###Z)
In properties for my project I have:
added C:\Program Files (x86)\AMD APP\include\ as an additional include directory
added C:\Program Files (x86)\AMD APP\lib\x86_64 as an additional library directory
added OpenCL.lib as an additional dependency
The errors I listed happen regardless of whether or not I take the last two steps. That is, the last two do not seem to be helping or harming anything
Summary of answers I provided in comments:
For a C++ application, you only need to #include <CL/cl.hpp>
Make sure you are linking with the correct OpenCL.lib (32-bit vs. 64-bit).
That's because clUnloadCompiler() was deprecated in OpenCL 1.2.
Add
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
to your code before
#include <CL/cl.h>
#include <CL/cl.hpp>
I wrote a sample program using QSqlDatabase object two years ago with a Qt configuration that depended on static libraries. It compiled ran as expected. Some time last year, I rebuilt the configuration using shared libraries and now I am getting the following errors.
Here is the error:
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) publ
ic: __thiscall QSqlDatabase::~QSqlDatabase(void)" (__imp_??1QSqlDatabase##QAE#XZ
) referenced in function _main
...
debug\qtsql.exe : fatal error LNK1120: 12 unresolved externals
Here are my includes and the instantiation of the object in main.cpp:
#include <Qt>
#include <QtDebug>
#include <QtSql\QSqlDatabase>
#include <QFile>
#include <QtSql\QSqlQuery>
#include <QString>
#include <QVariant>
#include <QDate>
int main()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
...
Also, here is my .pro file:
TEMPLATE = app
TARGET =
DEPENDPATH += . versions
INCLUDEPATH += .
# Input
SOURCES += main.cpp
# Libraries
QMAKE_LIB_DIR += C:\\Qt\\4.7.0\\lib
I thought that last line in the .pro file would give me a link to any library I might need in Qt. I'm pretty ignorant of what it takes to link to the Qt .dll's.
What am I missing to get the program to see the QSqlDatabase library?
Also, must I specify the library even though I have given it the header file and library directory?
CONFIG += qt
QT += sql
might be missing here (link to qmake docs)
Here is a link to the Qt sql examples. Perhaps you find inspiration/guidance there.