8 years, 8 months ago.

Compiler Error 349 raised by your class example

Under Step 2, making is a class, the first section of main.cpp (copied below):

main.cpp

class Flasher {
public:
    Flasher(PinName pin) : _pin(pin) {  // _pin(pin) means pass pin to the DigitalOut constructor
        _pin = 0;                                        // default the output to 0
    }

The 6th line raises a compiler error - "Error: No operator "=" matches these operands in "main.cpp" "

Can't see why this would be? I may well have made an error copying it over, but I can't see anything.

Question relating to:

Hi George, I can only re-create your error if I Use _pin = "O"; i.e different data types make sure it is _pin = 0; a numeral Regards

posted by Martin Simpson 05 Aug 2015

Hi Martin, I have published the code for reference, https://developer.mbed.org/users/melmon/code/MUX_class_test/ it does have a numerical 0

posted by George Edwards 05 Aug 2015

so you are trying to write a 0 to an Input? i.e. the analogue input..... just comment out the _pin = 0; regards

posted by Martin Simpson 05 Aug 2015
Be the first to answer this question.