3 years, 4 months ago.

Compiling error with IBMIoTClientLibrarySample

I receive the following message when I try to compile "IBMIoTClientLibrarySample" to mbed 1768.

Error number: 330-D Resource: Timer.h Folder: extras/IBMIoTF/mbed-os.lib/drivers

Description: Error: "mbed::NonCopyable<T> &mbed::NonCopyable<T>::operator=(const mbed::NonCopyable<T> &) [with T=mbed::Timer]" (declared at <a href="#" onmousedown="mbed_doc_goto('/IBMIoTClientLibrarySampleextras/IBMIoTF/mbed-os.lib/platform/NonCopyable.h', '163'); return false;">/extras/IBMIoTF/mbed-os.lib/platform/NonCopyable.h:163</a>) is inaccessible in "extras/IBMIoTF/mbed-os.lib/drivers/Timer.h", Line: 50, Col: 24

When I follow the link to "/IBMIoTClientLibrarySampleextras/IBMIoTF/mbed-os.lib/platform/NonCopyable.h" I receive another error. "Unable to load source file for /IBMIoTClientLibrarySampleextras/IBMIoTF/mbed-os.lib/platform/NonCopyable.h" the document reference to this source file is incomplete.

Any help would be greatly appreciated.

1 Answer

3 years, 3 months ago.

Hi Chris,
you can see another discussion as follows.
/questions/78698/Program-for-STM32F411RE-wont-compile/
/questions/78795/Strange-Compile-Error-of-Eclipse-Paho-MQ/

In addition, I found a good example for the NonCopyable countermeasure.

Import libraryMiCS6814_GasSensor

A component library for MiCS-6814 Multichannel Gas Sensor (seeed)

MiCS6814_GasSensor.h

public:
    MiCS6814_GasSensor(PinName sda, PinName scl, char slave_adr = SLAVE_ADDRESS_MiCS6814);
    MiCS6814_GasSensor(I2C &i2c_obj, char slave_adr = SLAVE_ADDRESS_MiCS6814);
// ---Omitted---
private:
    I2C  *_i2c_p;
    I2C  &_i2c;

MiCS6814_GasSensor.cpp

MiCS6814_GasSensor::MiCS6814_GasSensor(PinName sda, PinName scl, char slave_adr)  :
    _i2c_p(new I2C(sda, scl)),    _i2c(*_i2c_p),    _address(slave_adr) 
{
    initialize();
}
 
MiCS6814_GasSensor::MiCS6814_GasSensor(I2C &i2c_obj, char slave_adr)   :
    _i2c_p(NULL),    _i2c(i2c_obj),    _address(slave_adr) 
{
    initialize();
}