This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320C6678: time.h and clock_gettime linking error

Part Number: TMS320C6678
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

Hi,

I am trying to compile a larger project - initially made for linux - which makes use of clock_gettime() for approximate profiling. I was able to reproduce the linker error using a small example:

Building file: "../hello.c"
Invoking: C6000 Compiler
"/home/idris/ti/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6600 --include_path="/home/idris/ti/bios_6_73_00_12/packages/ti/posix/ccs" --include_path="/home/idris/workspace_v8/first_hello_world" --include_path="/home/idris/ti/ti-cgt-c6000_8.2.2/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="hello.d_raw"  "../hello.c"
Finished building: "../hello.c"
 
Building target: "first_hello_world.out"
Invoking: C6000 Linker
"/home/idris/ti/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6600 -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"first_hello_world.map" -i"/home/idris/ti/ti-cgt-c6000_8.2.2/lib" -i"/home/idris/ti/ti-cgt-c6000_8.2.2/include" --reread_libs --define=COREn=1 --diag_wrap=off --display_error_number --warn_sections --xml_link_info="first_hello_world_linkInfo.xml" --rom_model -o "first_hello_world.out" "./hello.obj" "../C6678_unified.cmd"  -llibc.a 
<Linking>
 
 undefined     first referenced
  symbol           in file     
 ---------     ----------------
 clock_gettime ./hello.obj     
 
error #10234-D: unresolved symbols remain

The corresponding code is:

#include <stdio.h>
#include <time.h>
#include <sys/time.h>
int main(void) { struct timespec tic, toc; clock_gettime(CLOCK_MONOTONIC, &tic); printf("Hello World!\n"); clock_gettime(CLOCK_MONOTONIC, &toc); return 0; }

I guess that I am not linking some library, but I could not figure out what is missing yet. Would you have any hints?

Thank you very much for your help.

Best wishes,

Idris