undefined reference to `sscanf'

int setState(String arguments) {
  char argStr[6];
  int index;
  int value;
  sscanf(argStr, "%d=%d", &index, &value);

  //if (index >= 0 && index < count) {
    digitalWrite(relayPins[index], value == 1 ? HIGH : LOW);


I get this error:

sketch/OakTemp.ino.cpp.o:(.text._Z8setState6String+0x8): undefined reference to sscanf' sketch/OakTemp.ino.cpp.o: In function setState(String)’:
/Users/nic/Documents/Arduino/OakTemp/OakTemp.ino:34: undefined reference to `sscanf’
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Oak by Digistump (Pin 1 Safe Mode - Default).

I realize I can get the same result without using sscanf, but I think it’s going to come in handy as I expand upon what I have here.

Did you

#include <stdio.h>


nope :frowning:


sorry, i meant nope as in "nope, that's not it. it's already there".

sorry, i meant nope as in "nope, that's not it. it's already there".

Well shit you might have said that instead of just the one word. If you want help you have to help those who are trying to help you. Try to be a little more verbose and let us know what the problem is.

That's why I apologized and corrected myself.
Again, sorry ... :astonished:

The Oak core is based on ESP8266 core, which does not currently have an implementation for sscanf(), even though it is declared in stdio.h. ESP8266 core 2.4.0 will have it... but that does not mean it will be automatically added to the Oak core.

I got the following standalone sscanf.h and sscanf.cpp working on Adafruit's Huzzah ESP8266