Hi, I was working on my code for autonomous, and I had the idea to write sensor values to a micro SD card so I can improve my autonomous, and also have a copy of the data for notebooking, etc…
Here’s a bit of my code:
FILE* AutoData = fopen(“AutoData.txt”, “a”);
fprintf(AutoData, “Hello World”);
fclose(AutoData);
This works fine, but I need to store floats, and not just strings, so I was trying to use the std::to_string() function, but including the necessary libraries gives me an error, I know that including these libraries works on Vexcode V5 Pro, is there anything I am doing wrong to use it for IQ?
The error is this: windows build for platform vexiq2
“CXX src/main.cpp”
In file included from src/main.cpp:8:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\iostream:39:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\ostream:38:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\ios:42:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\bits/ios_base.h:41:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\bits/locale_classes.h:40:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\string:52:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\bits/basic_string.h:6352:
In file included from C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\ext/string_conversions.h
:41:
C:\Program Files (x86)\VEX Robotics\VEXcode IQ\sdk/vexiq2/gcc/include/c++/7.3.1\cstdlib:75:15: fatal error: ‘stdlib.h’ file not found
#include_next <stdlib.h>
^~~~~~~~~~
1 error generated.
make: *** [vex/mkrules.mk:13: build/src/main.o] Error 1
make process closed with exit code : 2
Thanks for your help