Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build within Arduino IDE? #21

Open
baycom opened this issue Nov 24, 2024 · 2 comments
Open

How to build within Arduino IDE? #21

baycom opened this issue Nov 24, 2024 · 2 comments

Comments

@baycom
Copy link

baycom commented Nov 24, 2024

As a PlatformIO user I am trying to compile the project with the Arduino IDE. After setting my ESP32 board type, adding all libraries manually and clicking on 'verify' I get errors like these:
.../proj/MBusino/src/MBusino/Server.h: In function 'void setupServer()':
.../proj/MBusino/src/MBusino/Server.h:2:3: error: 'server' was not declared in this scope; did you mean 'Server'?

Is there any document describing how to properly build this project?

@Zeppelin500
Copy link
Owner

Mh, do you use Arduino IDE 2?
Yes, it's a weakness of Arduino IDE, that you can't specify the exact libraries.
But I think, server.h is only one part of my outsourced code parts in src.
All my used Libraries are the newest from the Library Manager beside "ESPAsyncWebServer", use my version. Because the version in the manager is not longer compatible to the esp core code.
Gruß Zeppelin

@baycom
Copy link
Author

baycom commented Nov 25, 2024

I found the reason for the problem: Your filename server.h is very unfortunate as the same filename is being used by the arduino framework code within NetworkServer.h:
#include "Server.h"
When compiling the project the name collision causes the compiler to use your server.h file instead of the one contained in the arduino framework:

In file included from /Users/.../Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/Network/src/NetworkServer.h:22, from /Users/.../Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/Network/src/Network.h:13, from /Users/.../Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/WiFi/src/WiFiGeneric.h:39, from /Users/.../Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/WiFi/src/WiFiSTA.h:29, from /Users/.../Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/WiFi/src/WiFi.h:33, from /Users/.../Documents/Arduino/libraries/ESPAsyncWebServer/src/ESPAsyncWebServer.h:32, from /Users/.../proj/MBusino/src/MBusino/MBusino.ino:20: /Users/.../proj/MBusino/src/MBusino/Server.h: In function 'void setupServer()': /Users/.../proj/MBusino/src/MBusino/Server.h:2:3: error: 'server' was not declared in this scope; did you mean 'Server'? 2 | server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){

My solution to fix this issue is renaming your server.h file to httpserver.h - maybe you should consider doing the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants