Hi, I’m coding for my ROSbot in husarioncloud and I want to take two values of time, but i can’t doing because the compiler bring me this error.
Building…
using stable distribution
Not searching for unused variables given on the command line.
– The ASM compiler identification is GNU
– Found assembler: /usr/bin/arm-none-eabi-gcc
– Configuring done
– Generating done
– Build files have been written to: build_dir
Scanning dependencies of target main.elf
[100%] Building CXX object CMakeFiles/main.elf.dir/main.cpp.o
Linking CXX executable main.elf
/usr/lib/gcc/arm-none-eabi/4.8/…/…/…/arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-timesr.o): In function _times_r': /home/tin/projects/debian/arm-toolchain/collab-maint/newlib/build/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/timesr.c:60: undefined reference to
_times’
collect2: error: ld returned 1 exit status
CMakeFiles/main.elf.dir/build.make:85: recipe for target ‘main.elf’ failed
make[3]: *** [main.elf] Error 1
CMakeFiles/Makefile2:188: recipe for target ‘CMakeFiles/main.elf.dir/all’ failed
make[2]: *** [CMakeFiles/main.elf.dir/all] Error 2
CMakeFiles/Makefile2:235: recipe for target ‘CMakeFiles/main.hex.dir/rule’ failed
make[1]: *** [CMakeFiles/main.hex.dir/rule] Error 2
Makefile:175: recipe for target ‘main.hex’ failed
make: *** [main.hex] Error 2
I’m using
#include <time.h>
clock_t lastTwistTime;
lastTwistTime=clock();
Thanks