Hi guys.
I’m trying to include the thingset library into an Arduino Project.
The setup is
- visual studio code
- platform.io
- thingset lib copied into src folder
- main.cpp replaced with example code from thingset
Compiling the code results in:
Archiving .pio/build/nanoatmega328/libFrameworkArduinoVariant.a
src/thingset_txt.c: In function 'ts_json_serialize_value':
src/thingset_txt.c:196:60: error: expected ')' before 'PRIu64'
pos += snprintf(buf + pos, size - pos, "%" PRIu64 ",",
Adding the build flags:
build_flags =
-std=c++11
-D NATIVE_BUILD
-pthread
-Wall
-Wno-deprecated-declarations
-D TS_64BIT_TYPES_SUPPORT=0```
to the platformio.ini file results in:
Compiling .pio/build/nanoatmega328/src/cbor.c.o
Compiling .pio/build/nanoatmega328/src/jsmn.c.o
avr-gcc: error: unrecognized command line option '-pthread'
avr-gcc: error: unrecognized command line option '-pthread'
Compiling .pio/build/nanoatmega328/src/main.cpp.o
*** [.pio/build/nanoatmega328/src/jsmn.c.o] Error 1
Compiling .pio/build/nanoatmega328/src/thingset.c.o
*** [.pio/build/nanoatmega328/src/cbor.c.o] Error 1
avr-g++: error: unrecognized command line option '-pthread'
*** [.pio/build/nanoatmega328/src/main.cpp.o] Error 1
avr-gcc: error: unrecognized command line option '-pthread'
*** [.pio/build/nanoatmega328/src/thingset.c.o] Error 1
If I compile the project without the flag -pthread, I’m back at the beginning:
Archiving .pio/build/nanoatmega328/libFrameworkArduinoVariant.a
src/thingset_txt.c: In function 'ts_json_serialize_value':
src/thingset_txt.c:196:60: error: expected ')' before 'PRIu64'
pos += snprintf(buf + pos, size - pos, "%" PRIu64 ",",
I don’t now how to continue from here. Can I get rid of the use of pthread or do I need to include pthread to my project?
Best,
Dan