Undifined Reference error when using a Static library in a C project

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Undifined Reference error when using a Static library in a C project

728件の閲覧回数
ViduraErandika
Contributor II

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.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

693件の閲覧回数
CarlosGarabito
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信