I build a CPP static library including FREERtos POSIX C files and also some of my own CPP files with functions that use the included FREERtos POSIX functions itself. (such as pthread_create , pthread_join etc.)
After building a .a static library I wish to use it in a C project.
In my executable project I included the static library and headers. When I call the functions that were in FREERtos POSIX C files (such as pthread_create , pthread_join etc.) through the project C file the program works perfectly.
But if I call the CPP functions that were in my own CPP files that use the included FREERtos POSIX functions it says Undefined Reference to pthread_create, pthread_join etc.
What is the reason for this error?
ps: I included the CPP files headers in the executable project including extern C tag.
Hi Vidura, i think that you have a error because
- You can get a reference error about pthread when pthread.h is missing in your C code.
- Another name for pthreads is POSIX threads.
I recommend to you an excellent blog which talks about freeRTOS and you can learn so much about this
https://mcuoneclipse.com/tag/freertos/
Have a good day