Kuree / DQN

An efficient MAC layer protocol for IoT:rocket:
GNU General Public License v3.0
3 stars 4 forks source link

Error in protocol.h #2

Closed SanjayVijayKumar closed 4 years ago

SanjayVijayKumar commented 4 years ago

Hi i was trying to replicate your DQN implementation in arduino. I followed all the instructions that is mentioned in readme file.but when i tried to complie "device.ino" code in arduino IDE i am getting following error:

Arduino: 1.8.8 (Windows 10), Board: "Adafruit Feather M0, Arduino, Off"

In file included from C:.........\Distributed_Queuing\DQN-master\device\device.ino:1:0:

C:........\Arduino\libraries\protocol/protocol.h:70:10: fatal error: queue.h: No such file or directory

 #include <queue.h>

          ^~~~~~~~~

compilation terminated.

exit status 1
Error compiling for board Adafruit Feather M0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Kuree commented 4 years ago

It may depends on your compiler setup and build environment. Can you try something like <queue> or <Queue.h>?

See: https://forum.arduino.cc/index.php?topic=442690.0

SanjayVijayKumar commented 4 years ago

Hi thank you for your response. I used instead of and it worked. But now the error is pointing to .I am using 1.8.8 version of Arduino IDE. Could you tell me for what version of Arduino IDE your code compiles without any error.

Kuree commented 4 years ago

Unfortunately I don't have access to the Arduino boards any more and I can't recall which version I used while programming these files. Can you double check that etlcpp is installed properly? I think these files are provided through etlcpp, rather than from the Arduino.

SanjayVijayKumar commented 4 years ago

hi thank you for your suggestion. I again reinstalled etclcpp library and the error for missing libraries is gone.But now new errors i am gettting inside these libraries.

Arduino: 1.8.8 (Windows 10), Board: "Arduino Uno"

WARNING: Spurious .circleci folder in 'Embedded Template Library' library
WARNING: Spurious .vs folder in 'Embedded Template Library' library
In file included from C:\Users\....\Documents\Arduino\libraries\etl/map.h:45:0,

                 from C:\Users\...\Documents\Arduino\libraries\protocol/protocol.h:71,

                 from C:\Users\...\Desktop\Distributed_Queuing\DQN\dqn_tx\dqn_tx.ino:2:

C:\Users\...\Documents\Arduino\libraries\etl/pool.h:36:10: fatal error: new: No such file or directory

 #include <new>

          ^~~~~

compilation terminated.

exit status 1
Error compiling for board Arduino Uno.

I am using Arduino Ide for compiling and flashing this code. do I need to use any other tool other than this?

Kuree commented 4 years ago

I remember I was using M0 LoRa feather when I wrote the prototype. It requires to install a specific toolchain to interface with the pin out and compilation.

Based on the error, it seems like the compiler is compiling using C, e.g. gcc instead of C++ e.g. g++. Would you please double check that?

If I recalled correctly, the ETL usage is just for STL components. You should be able to swap it out with any stl compliant library and the code should just work.

SanjayVijayKumar commented 4 years ago

ok, thank you for the answer. But I am new to Arduino development .so can you please tell me how can I use the g++ compiler in Arduino. Any link or reference will be of great help to me. Sorry for asking this dumb question.

Kuree commented 4 years ago

Based on your board this could be a good place to start: https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins

SanjayVijayKumar commented 4 years ago

Hi, I looked at the link you provided. But it is showing how I can program Arduino using raspberry pi through ICSP. It tells me to grab and copy the .hex file of the desired program and flash it to Arduino from pi. But the problem is I am not even able to compile your repo code in Arduino IDE. Seems I am getting some kind of toolchain error.

Finally, I can compile your code. I was selecting the wrong board for compilation and had the wrong ETL library which was having a lot of issues. Thank you for your responses :)

Kuree commented 4 years ago

Glad you got it working.

Closing the issue for now.