再会
我正在尝试在 C++11 项目中使用 C SD 驱动程序/文件系统库(Keil MDK)。它是由 Keil MDK 5.23 中的包管理器添加的。我正在使用 ARMCC 5.06u4 进行编译
我收到警告class "_ARM_MCI_STATUS"
“没有合适的复制构造函数”,这很奇怪,因为它在中声明的标头具有extern "C" {
.
默认情况下,包没有将其设置为 C 或 C++ 的选项,但我已手动将文件添加为 C 文件。还是有问题。
该结构被声明extern "C" {
为:
typedef volatile struct _ARM_MCI_STATUS {
uint32_t command_active : 1; ///< Command active flag
uint32_t command_timeout : 1; ///< Command timeout flag (cleared on start of next command)
uint32_t command_error : 1; ///< Command error flag (cleared on start of next command)
uint32_t transfer_active : 1; ///< Transfer active flag
uint32_t transfer_timeout : 1; ///< Transfer timeout flag (cleared on start of next command)
uint32_t transfer_error : 1; ///< Transfer error flag (cleared on start of next command)
uint32_t sdio_interrupt : 1; ///< SD I/O Interrupt flag (cleared on start of monitoring)
uint32_t ccs : 1; ///< CCS flag (cleared on start of next command)
uint32_t reserved : 24;
} ARM_MCI_STATUS;
当在以下位置返回结构时会出现问题:
static ARM_MCI_STATUS GetStatus (MCI_RESOURCES *mci) {
return mci->info->status;
}
哪里status
被声明为ARM_MCI_STATUS status;
. 我不明白为什么这应该是一个问题。
如果我在没有 --cpp 的情况下编译,那么它编译没有问题。
有什么建议么?