muwerk/munet

error: 'queue' in namespace 'ustd' does not name a type ustd::queue<T_MSG *> msgqueue;

Closed this issue · 4 comments

I am using Arduino 1.8.13 because ESP-IDF does not support esp8266 yet, I think. There three esp development enviroments, arduino, pio, and esp-idf.

I copied the code on the README and tried to compile it and I get this error. The arduino IDE does everything for you so I am a little lost, I like cmake better.

Looking at the library source, it seems Ok.
I am lost about this error. Any ideas?

In file included from /home/pi/Arduino/munet/munet.ino:3:0:
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h:209:5: error: 'queue' in namespace 'ustd' does not name a type
ustd::queue<T_MSG *> msgqueue;
^
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h: In constructor 'ustd::Scheduler::Scheduler(int, int, int)':
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h:231:36: error: class 'ustd::Scheduler' does not have any field named 'msgqueue'
: taskList(nTaskListSize), msgqueue(queueSize), subscriptionList(nSubscriptionListSize) {
^
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h: In destructor 'virtual ustd::Scheduler::~Scheduler()':
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h:257:17: error: 'msgqueue' was not declared in this scope
int l = msgqueue.length();
^
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h: In member function 'bool ustd::Scheduler::publish(String, String, String)':
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h:396:20: error: 'msgqueue' was not declared in this scope
return msgqueue.push(pMsg);
^
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h: In member function 'void ustd::Scheduler::checkMsgQueue()':
/home/pi/Arduino/libraries/Muwerk_scheduler_library/scheduler.h:455:24: error: 'msgqueue' was not declared in this scope
while ((pMsg = msgqueue.pop()) != nullptr) {
^
exit status 1
Error compiling for board Generic ESP8266 Module.

Something seems broken in Arduino-IDEs include resolution for ESP8266 (probably another queue.h file somewhere).

The issue gets fixed, if you use an absolute path to include USTD's queue.h.

Put something like his in your code (after the platform #define ESP):

#include </<your-absolute-path-to-arduinos-lib-folder>/Arduino/Libraries/Muwerk_ustd_library/queue.h>

That should fix the compile. I'll have a look why this happens with ESP8266 and Arduino-IDE.

Thanks, by putting #Include <...../queue.h> at top works.
I thought it might be a path error, that is why I complained about IDEs.

I see you prefixed the include files, great idea.

@greenpdx : Thank you for your report. It caused us to clean up the include names, so that future users won't stumble over this problem.