11 years, 5 months ago.

m3pi - No instance of constructor "mbed::Stream::Stream" matches the argument list Error 289


I can no longer compile new projects. Old projects work. If I export m3pi.h and/or mbed.h from the old project to create a new project the new project will still not compile.

I have created a new project, copy and paste code from a project that does compile, still get this error.

The error code Line 27 Col 95 reference the constructor of m3pi object.

What do I need to change be able to compile?

1 Answer

11 years, 5 months ago.

Publishing your code is easier for us, and easier for you since you can just press publish instead of making a screenshot.

Anyway without trying to compile it, but what should work is going to m3pi.cpp, and there it says Stream("m3pi") in two places. Rename that to Stream();. I believe in newer mbed releases the option to give it a name was removed.

Accepted Answer

This worked.. Could you please explain further why did does?

So in future code I should not create an instance of my m3pi with a name. How would I correctly reference it?

posted by K Payne 11 Dec 2012

Your m3pi instance still has a name, robot. However internally it uses the stream class, which is used for for example printf. In the past you could give an instance of the stream class an extra, optional, name, in this case "m3pi". In one of the new mbed library releases this ability was removed (I dont know if it had any uses), so now your code still tried to give it a name, but the library didnt want a name, so it gave an error.

posted by Erik - 11 Dec 2012