SerialUI Error "no matching function call"

Greetings,

I am trying to test run SerialUI using a couple of examples. I have installed the SerialUI library which is showed installed on the library manager list.

I tried two example programs both of which include the "SerialUI.h" header file. With both examples I get the same error when the build encounters this code:

SUI::Menu * mainMenu = mySUI.topLevelMenu();

mainMenu->setName(top_menu_title);

"no matching function call to 'SUI::Menu::setName(const char [23])"

SuperBlinkerSerialUI_Example:643:35: error: no matching function for call to 'SUI::Menu::setName(const char [23])'

It seems like it cannot find the files however the SerialUI library directory is located in username\documents\Arduino\libraries along with other library directories.

Any helpful suggestions would be appreciated!

Thanks in advance.

tma

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you programming for?

Thanks... Tom... :slight_smile:

It seems like it cannot find the files

Why do you think that? What the message is saying is that the setName() function does not take an array of chars.

That library is a rats nest of includes. Without more effort than I feel like spending, I can't see where setName() is defined as taking anything other than a FlashStringHelper (generated by something like setName(f("The menu name is Bob")); ).

Greetings,

Thank you for the repies!

The example I am working with is directly from the library and is the recommended tutor from the readme.md file found on github. The error is generated from line 643 of the source code which can be found at:

** Library example: SerialUI : SuperBlinker

The board is an Atmega328 Duemilanove. I tried changing the target to a Mega board and got the same error.

The library version is 2.2.0 which seems recent as I believe the release on GitHub is 2.1.x. I tried two earlier versions of the library and get the same error.

The string is declared on line 195 as follows:

SUI_DeclareString(top_menu_title, "SuperBlinker Main Menu");

As the character count is correct it would appear that Arduino IDE has the correct string in view.

The Arduino IDE does have the library in site as it is finding SerialUI.h OK. On line 32 in turn includes:

#include "includes/SUIMenu.h"

I found the setname prototype in SUIMenu.h[/i] and the function in SUIMenu.cpp line 257 which is:

void Menu::setName(SOVA_FLASHSTRING_PTR namestr) {
menu_name = namestr;
}

I need to review cpp but I believe the constructor for mySUI is on line 240 of the app source code:

SUI::SerialUI mySUI = SUI::SerialUI(device_greeting);

I believe a pointer to define mainmenu is on line 629:

SUI::Menu * mainMenu = mySUI.topLevelMenu();

I apologize for not yet knowing how to list code here properly.

tma

I apologize for not yet knowing how to list code here properly.

Perhaps it is time to figure that out as no one can help with you just posting bits and pieces of things.

How to use this forum

This is a sticky post at the top of every forum sub-section. Be sure to read item 7.

Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Greetings,

I am currently back to latest version 2.2.0 which I installed via the library manager in Arduino. I alternately downloaded the latest version from GitHub and tried it and got the same error message. The source code for SuperBlinkerSerialUI is an example app given within the library.

Thanks!
tma

tma:
The source code for SuperBlinkerSerialUI is an example app given within the library.

What makes you think it's called SuperBlinkerSerialUI? In the codebender link you posted above, it's clearly titled SuperBlinker. The only examples given with SerialUI 2.2.0 are Basic and Sanctuary. The last time there was an example with a name even close to SuperBlinkerSerialUI was in 1.14.0, but that example was named SuperBlinker, not SuperBlinkerSerialUI.

Your problem is that you're trying to compile code that was written for the 1.14.0 version of SerialUI. The library has changed since then, making it no longer compatible with the SuperBlinker code. If you're really so set on compiling SuperBlinker, you can roll back to 1.14.0 like this:

  • Sketch > Include Library > Manage Libraries
  • Wait for download to finish.
  • In the "Filter your search" field, type "serialui".
  • Press "Enter".
  • Click on "SerialUI by Pat Deegan".
  • From the drop down version menu, select "1.14.0".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

But is it really so important for you to use this SuperBlinker thing? If not, I'd recommned sticking with the modern version of the library and just study the examples that do come with it. Those examples compile with 2.2.0, no problem. Hopefully they will give you enough of a demonstration of how to use the library so that you can write your own code.

Many thanks!

I have been struggling trying many options and clearly I became confused. Initially I did go directly to the version 2.2.0 library examples and didn't find a good fit example. I then went on to the README.md file to try and find direction there.

I guess what got me going down the wrong track is the reference to SuperBlinker in the README.md file in the version 2.2.0 library. I also found reference to it elsewhere, I think on GitHub. Early in the exercise I added a SerialUI suffix to the app name to flag the association with SerialUI within my own system and forgot that I did that.

Also whilst groping for a reference app I did a Google search and went to a SerialUI tutor page that obviously, with hindsight, also provided app code for an old version which happened to produce the same error:

https://flyingcarsandstuff.com/projects/serialui/using-serialui/

I guess what I need to learn is how to tell what version of library an app is written for. I did try a couple of older 1.x.x versions via the library manager and they also gave me the same error. Is there a way to tell - how did you determine it was written for version 1.14.0?

Thanks Again!

I agree that it's confusing they didn't update the readme when they removed SuperBlinker from the examples. I noticed that also.

tma:
I guess what I need to learn is how to tell what version of library an app is written for. I did try a couple of older 1.x.x versions via the library manager and they also gave me the same error. Is there a way to tell

If the program is bundled with the library we can only hope that it is compatible. However, things are not so simple when you find code elsewhere. In that case, your only way to know for sure is if the author of the code documented which version of the library they were using. That's pretty rare. The good news is that conscientious library authors will avoid making breaking changes to their libraries unless it's absolutely necessary. When they follow the semver specification, the version number will indicate where breaking changes happened. Whenever there is a breaking change to the library API, the major version number should be incremented, as happened between 1.14.1 and 2.2.0. If can get a date on the code you find, that might provide a clue. Hopefully, the code author would use the most recent version of the library at that time, and you know for certain they weren't using any version released after that date.

tma:
how did you determine it was written for version 1.14.0?

I went back through each version of the library until I found the one which had an example named SuperBlinker. That example is missing from all the versions after 1.14.0. The version also went from 1.x.x to 2.x.x after 1.14.0, so I knew there was a breaking change to the library. I did a compilation of SuperBlinker with 1.14.0 and there were no errors, so I figured that was the one.

Greetings,

Gosh many thanks for the great support here! This has been yet another learning experience for me, :slight_smile: .

As it turns out I don't think I will use SerialUI. All I am looking for is a simple text menu system that will give the user the chance to change a few modes and enter a couple of numbers using the text terminal app of choice. Serial UI seems more advanced than what I need and would be a bit too heavy on resources for my lowly 328 board considering the needs of my app code.

I will pursue the library version issue more vigorously when I encounter glitches in the future.

Thanks again!

tma

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per