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.

Semaphore_Handle 编译错误

Other Parts Discussed in Thread: SYSBIOS

Hi,

我在制作自己的lib库时,用到SYSBIOS信号量,(我用的BIOS6),写如下代码:

Semaphore_Handle write_sem;

write_sem = Semaphore_create(1,NULL,NULL);

 

但是会提示“ identifier "Semaphore_Handle" is undefined”错误。


我在头文件中已经添加了“#include <ti/sysbios/knl/Semaphore.h>”;在工程右击的Properties下的Include options 下也添加了

"C:\Program Files\Texas Instruments\bios_6_32_04_49\packages"这个路径,用于确保头文件位置。

 

如果我添加“#include <ti/sysbios/ipc/Semaphore.h>”,就不会有上述这个错误,ipc下和knl的代码规格一致,路径都在

        C:\Program Files\Texas Instruments\bios_6_32_04_49\packages,其他文件未变。

 

打开ti/sysbios/knl/Semaphore.h,文件里有“#define Semaphore_Handle ti_sysbios_knl_Semaphore_Handle”,说明这个

Semaphore_Handle已经定义,但是怎么编译的时候还是会有错误?

用ipc的头文件虽然可以正确编译库,但是在自己的sysbios工程里用编译好的库时,因为不是ipc所以错误一大堆,

而且不符合sysbios工程。

请问高手,还需要注意什么呢?

万分感谢。