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.

[参考译文] CC2652RB:如何一起编译C/C++源文件?

Guru**** 2539500 points
Other Parts Discussed in Thread: CC2652RB

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1091316/cc2652rb-how-to-compile-c-c-source-file-together

部件号:CC2652RB

您好,TI:

我正在 simplelink_cc13x2_26x2_SDK_4_30_00_54\examples\RTOS\CC2652RB_LAUNCHTXL\DRIVERS\empti\titos\CCS 中使用一个C++文件,该文件是传感器的驱动程序(ds18b20.h和ds18b20.cpp)。

现在,当我在empty.c中包含ds18b20.h并编译该项目时,出现如下错误:

我的代码如下:

#include "Modules/DS18B20/ds18b20.h"

DS18B20 ds;

void *mainThread(void *arg0)
{
    INIT_CODE();

    while (1) {
        sleep(1);

        while(ds.selectNext()) {
            DBG_INFO("Current Temp is: %.2f", ds.getTempC());
        }

    }
}

您能帮助我了解如何在C项目中编译C++代码吗?

谢谢!