Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Another String error solved, maybe. ( String error)
Another String error solved, maybe. [message #46769] Sun, 31 July 2016 17:30 Go to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
from old apps edit field <<= just remove the =


String error


filename0=(String)OutFile;


error: no matching function for call to 'Upp::String::String(Upp::EditField&)'


All of the Strings are the upp Strings
There are no uses of the std strings

It has been several years since compiling this app but it was good before

Neil

[Updated on: Wed, 17 August 2016 10:12]

Report message to a moderator

String error has not been solved [message #46805 is a reply to message #46769] Sat, 13 August 2016 06:40 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor

filename0=(String)OutFile;


error: no matching function for call to 'Upp::String::String(Upp::EditField&)'


Is this an instance where std:string needs to be used or just a dumb error I have made when using upp 10100

I did not have this error with a previous version of upp but that could have been a few years ago.

Neil

[Updated on: Sat, 13 August 2016 06:51]

Report message to a moderator

Re: String error has not been solved [message #46814 is a reply to message #46805] Tue, 16 August 2016 11:54 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 227
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Neil,

What is variable type for OutFile

Few lines of code will be useful.


Warm Regards

Deepak
Re: String error has not been solved [message #46819 is a reply to message #46814] Thu, 18 August 2016 10:59 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
deep wrote on Tue, 16 August 2016 02:54
Hi Neil,

What is variable type for OutFile

Few lines of code will be useful.



After switching computers I am having a Problems finding the app that had 'OutFile' that was giving me that error'
I think all my 'filenames' infile, outfile are just upp String variables, they are just names, as upp Strings.

Some apps I am trying to update to the mingw compiler are having other issues, like one has 16 errors like:
C:\upp-mingw-10004\upp\uppsrc\Web\html.cpp (347): error: ambiguous overload for 'operator+' (operand types are 'Upp::HtmlTag' and 'Upp::Htmls')

I don't recall using html in my code but I was getting help,
For the errors displaying the filenames in an edit-field by just removing the '=' seems to allow the apps to compile and run, as Mentioned in a previous post.

If I get the error mentioned again I will include several lines of code and I could attach the complete app.
Re: Another String error solved, maybe. Not solved !! [message #46873 is a reply to message #46769] Sat, 03 September 2016 14:36 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
This is with upp 10200

three errors the same
(142): error: no matching function for call to 'Upp::String::String(Upp::EditField&)'
(150) and (158)

C:\upp-mingw-10200\upp\MyApps\DGPSmerge\DGPSmerge.cpp (150): error: no matching function for call to 'Upp::String::String(Upp::EditField&)'


C:\upp-mingw-10200\upp\MyApps\DGPSmerge\DGPSmerge.cpp (142): error: no matching function for call to 'Upp::String::String(Upp::EditField&)'





C:\upp-mingw-10200\upp\MyApps\DGPSmerge\DGPSmerge.cpp (142): error: no matching function for call to 'Upp::String::String(Upp::EditField&)'



#142 filename0=(String)OutFile;
# FileOut outF(filename0);
if(!outF) {
Exclamation("Unable to open Out file [* " + DeQtf(filename0));
return;
}

// FileIn in1((String)fn1);
#150 filename1=(String)BaseFile;
FileIn in1(filename1);
if(!in1) {
Exclamation("Unable to open Base file [* " + DeQtf(filename1));
return;
}

// FileIn in2((String)fn2);
#158 filename2=(String)RoamFile;
FileIn in2(filename2);


I don't understand what the problem is and what the upp changes are that causes this.

I still have the executable app that upp compiled before a few years ago that works OK still.

Here is a thread started by Mirek about changes "EditField::operator String() removed" with a mention of "is very easy to fix"
I do not understand what is required to be done. http://www.ultimatepp.org/forums/index.php?t=msg&goto=46 824&#msg_46824

[Updated on: Sat, 03 September 2016 15:11]

Report message to a moderator

Re: Another String error solved, maybe. [message #46877 is a reply to message #46769] Sun, 04 September 2016 17:30 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 227
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Neilson,

Try following.

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : public TopWindow
{
	EditField infile,outfile,basefile;
	String In,Out,Base;
	
	App();
};


App::App()
{
	infile.SetText("In File");
	outfile.SetText("Out File");
	basefile.SetText("Base File");

	Add(infile.TopPos(4,20).HSizePos());
	Add(outfile.TopPos(28,20).HSizePos());
	Add(basefile.TopPos(52,20).HSizePos());
	
	Title("Test EditField").Sizeable().Zoomable();

	In = ~infile ;
	Out = ~outfile ;
	Base = ~basefile ;

	DUMP(In);
	DUMP(Out);
	DUMP(Base);
}


GUI_APP_MAIN
{
	App app;
	app.SetRect(100,100,300,200);
	app.Run();
}


This will give error. Will not compile.
	In = infile ;



Warm Regards

Deepak
Re: Another String error solved, maybe. [message #46879 is a reply to message #46877] Sun, 04 September 2016 20:47 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Thanks deep, I will try your example.
attached is a 7z of my app dgpsmerge

The base file is gps data at a known position. Whatever deviation from there is 'merged' with a roaming file to remove most atmospheric deviation in a gps signal. Just a standard method but I created my upp app to do it.
  • Attachment: DGPSmerge.7z
    (Size: 6.29KB, Downloaded 105 times)
Re: Another String error solved, maybe. [message #46880 is a reply to message #46879] Mon, 05 September 2016 15:24 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 227
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Neilson,

Your code will compile and run with following changes

//	filename0=(String)OutFile;		
	filename0= ~OutFile;


//	filename1=(String)BaseFile;
	filename1=~BaseFile;

//	filename2=(String)RoamFile;
	filename2=~RoamFile;


Warm Regards

Deepak
Re: Another String error solved, maybe. [message #46882 is a reply to message #46880] Mon, 05 September 2016 18:35 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Thank you very much Deepak!!



After making the changes it compiles OK.

All the files this app uses are in the same directory so once that is set that directory opens automatically.

Thanks again Deepak

Neil

[Updated on: Mon, 05 September 2016 20:47]

Report message to a moderator

Re: Another String error solved, maybe. [message #46905 is a reply to message #46882] Fri, 09 September 2016 10:43 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
I found another thing related to String and I'm not sure of it should work with the new core or not.

Index<String>  words;
Sort(words);


This won't compile. Is it supposed to?
Re: Another String error solved, maybe. [message #46906 is a reply to message #46905] Fri, 09 September 2016 11:50 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 227
Registered: July 2011
Location: Bangalore
Experienced Member
Hi

The problem reported in compile is for Sort()

Sort internally using

template <class T>
inline void Swap(T& a, T& b) { T tmp = pick(a); a = pick(b); b = pick(tmp); }


which generates compile error for "="

c:\devtools\g_upp\uppsrc\core\Defs.h(462): error C2678: binary '=': no operator found which takes a left-hand operand of type 'const Upp::String' (or there is no accep
    table conversion)


Warm Regards

Deepak
Re: Another String error solved, maybe. [message #46913 is a reply to message #46905] Sat, 10 September 2016 07:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13051
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 09 September 2016 10:43
I found another thing related to String and I'm not sure of it should work with the new core or not.

Index<String>  words;
Sort(words);


This won't compile. Is it supposed to?


No.

But you can use 'SortIndex'.

Mirek
Re: Another String error solved, maybe. [message #46914 is a reply to message #46913] Sat, 10 September 2016 09:00 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
mirek wrote on Sat, 10 September 2016 08:49
cbpporter wrote on Fri, 09 September 2016 10:43
I found another thing related to String and I'm not sure of it should work with the new core or not.

Index<String>  words;
Sort(words);


This won't compile. Is it supposed to?


No.

But you can use 'SortIndex'.

Mirek

Interesting design.

Why no overload Sort for Index to call SortIndex? Would help random users.
Re: Another String error solved, maybe. [message #46915 is a reply to message #46914] Sat, 10 September 2016 09:49 Go to previous message
mirek is currently offline  mirek
Messages: 13051
Registered: November 2005
Ultimate Member
cbpporter wrote on Sat, 10 September 2016 09:00
mirek wrote on Sat, 10 September 2016 08:49
cbpporter wrote on Fri, 09 September 2016 10:43
I found another thing related to String and I'm not sure of it should work with the new core or not.

Index<String>  words;
Sort(words);


This won't compile. Is it supposed to?


No.

But you can use 'SortIndex'.

Mirek

Interesting design.

Why no overload Sort for Index to call SortIndex? Would help random users.


Well, maybe. However, 'Sort' is meant to be generic sorting algorithm for containers with certain set of requirements and all it does is sorting. Index does not match these requirements.

Sorting Index is quite more complex, as it works by converting Index to Vector, sorting, then recreating Index back (restoring hashing info). Maybe the warning that you are doing something unusual is in place here... Forcing user to write SortIndex instead of just Sort to acknowledge this fact is the idea....

Mirek

[Updated on: Sat, 10 September 2016 09:49]

Report message to a moderator

Previous Topic: How do I swap the Ctrl in the TabCtrl ?
Next Topic: Image to an SQLite blob windows 10
Goto Forum:
  


Current Time: Sat Jan 23 18:13:10 CET 2021

Total time taken to generate the page: 0.01648 seconds