Rtos queue mbed

Hello,i use a queue to send my data in a thread A at thread B but if i use a second queue, i find error in compilation.

So what compilation error do you see?

I have a thread running into the gps.cpp file and i want to share some data to main() thread that is running into the main.CPP() using the queue.

I have this declaration in gps.cpp
MemoryPool<message_t, 16> mpool;
Queue<message_t, 16> queue;
message_t *message = mpool.alloc();

Now i have to call gueue.get() API and mpool.free() in the main.cpp this doesn’t work. I tried to do below in the main.cpp.
extern Queue<message_t, unsinged int> queue;
extern MemoryPool<message_t, unsigned int> mpool;

This doesn’t work it gives a compilation error Queue and Memory pool is not a templet. Is it a limitation of the queue to use with extern? If not than how to use it in different files

1 Like

Hi @surajdagar - I just made a similar post. Did you ever find a solution to this?