You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard function difftime from time.h and ctime seems to be not available for linker. The code that uses this function compiles, but I get linker errors:
C+ app/application.cpp
AR out/build/app_app.a
LD out/build/app.out
out/build/app_app.a(application.o):(.text._Z8showTimev+0x10): undefined reference to `difftime'
out/build/app_app.a(application.o): In function `showTime()':
/opt/Sming/Sming/SmingCore/Boards.h:18: undefined reference to `difftime'
collect2: error: ld returned 1 exit status
I suspect double is used as historically some platforms used floating-point values to represent time_t. Better to just subtract the two values and stick with integers.
The standard function
difftime
fromtime.h
andctime
seems to be not available for linker. The code that uses this function compiles, but I get linker errors:Sample code that causes this:
Do I need to do anything special to use it?
The text was updated successfully, but these errors were encountered: