Closed ed7coyne closed 8 years ago
We should also make sure if possible that the conversion doesn't add too many extra copies.
Maybe we could have overrides that also accept char*
+ size.
I don't think this will be feasible. Unfortunately I did not find out until pretty late that Arduino IDE cannot link std::string at all :(
I will keep looking for a way to make it happen but you just get a bunch of:
undefined reference to
std::basic_string<char, std::char_traits
I have a branch pretty much ready to go otherwise as this is a linking error so all compilation issues are fixed: https://github.com/googlesamples/firebase-arduino/compare/master...ed7coyne:remove-arduino-string
So you should only need to force the instantiation of the std::string template to make that work:
template class std::basic_string<char>;
See https://github.com/esp8266/Arduino/issues/1136#issuecomment-162331360
hmm good find. Addressed most of them. Now I am just left with:
sketch/FirebaseDemo_ESP8266.ino.cpp.o: In function
loop':
/usr/local/google/home/edcoyne/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/bits/basic_string.tcc:732: undefined reference to std::__throw_out_of_range(char const*)' sketch/FirebaseDemo_ESP8266.ino.cpp.o: In function
std::basic_string<char, std::char_traits
If they will accept https://github.com/esp8266/Arduino/pull/2062 it will fix it. We may need a temporary fix on our side until then.
my code cannot be compiled for Arduino since adding this library:
#include <FirebaseArduino.h>
Error:
`/Users/dirkvranckaert/Documents/Arduino/libraries/firebase-arduino-master/src/FirebaseArduino.h:20:18: fatal error: string: No such file or directory
I guess that's what this issue is all about. How can I get passed this issue and still compile? Why is this an issue with my arduino uno?
@dirkvranckaert this library currently only works with esp8266 boards (arduino compatible, builtin WiFi). I'd be tricky to get it to work with Uno unless you get some kind of Wifi or Ethernet shield.
Allright, I have one around (a Wemos D1), just gave it a try and indeed compilation succeeds! Will try one of the examples! Thanks a lot!
Fixed with #169
my code cannot be compiled for Arduino since adding this library:
#include <FirebaseArduino.h>
Error:/Users/dirkvranckaert/Documents/Arduino/libraries/firebase-arduino-master/src/FirebaseArduino.h:20:18: fatal error: string: No such file or directory #include <string>
I guess that's what this issue is all about. How can I get passed this issue and still compile? Why is this an issue with my arduino uno?
Even I am facing the same issue. I don't have a builtIn WiFi Board. I am using Arduino Mega 2560 with ESP8266. And using SoftwareSerial to communicate with the ESP8266. Can you help me out please?
We should translate from String to std::string at the FirebaseArduino layer and use std::string on all internal classes. This will make the library portable and will make testing easier.
Once this is done we can stop patching ArduinoJson releases to address our conflicting String overrides as well.