Thread View: comp.lang.c++.leda
2 messages
2 total messages
Started by Ashvin Kannan
Tue, 01 Aug 1995 14:46
need help: on using g++ String with LEDA 3.1.2
Author: Ashvin Kannan
Date: Tue, 01 Aug 1995 14:46
Date: Tue, 01 Aug 1995 14:46
41 lines
1429 bytes
1429 bytes
Hi all,
I'm having problems using the g++ "String" class (from 2.6.3) with LEDA
3.1.2. In using LEDA's "dictionary" class I get an error message that
"compare" is not defined, but in looking at g++'s String.h, I can see it.
It's probably something obvious, I'm missing out on.
Please help! Thanks.
Ashvin
Error messages:
----------------------------------------------------------------------
ERROR compare undefined
IOT trap
----------------------------------------------------------------------
Code:
----------------------------------------------------------------------
#include <String.h>
#include <LEDA/dictionary.h>
int main()
{
dictionary<String, int> D;
dic_item it;
String s;
while (cin >> s)
{
it = D.lookup(s);
if (it == nil)
D.insert(s,1);
else
D.change_inf(it, D.inf(it)+1);
}
forall_items(it,D)
cout << D.key(it) << ":" << D.inf(i)t << endl;
return 0;
}
----------------------------------------------------------------------
Re: need help: on using g++ String with LEDA 3.1.2
Author: Heribert Dahms
Date: Tue, 01 Aug 1995 19:10
Date: Tue, 01 Aug 1995 19:10
18 lines
1412 bytes
1412 bytes
In <ASHVIN.95Aug1104611@parrot.bu.edu> ashvin@raven.bu.edu writes:
: I'm having problems using the g++ "String" class (from 2.6.3) with LEDA
: 3.1.2. In using LEDA's "dictionary" class I get an error message that
: "compare" is not defined, but in looking at g++'s String.h, I can see it.
: #include <String.h>
^^^^^^^^ Instead try:
#include <LEDA/string.h>
: #include <LEDA/dictionary.h>
I've never used g++ strings, but in an earlier life (before switching to
Tcl/Tk 8-) I used LEDA together with InterViews 3.1 and the mixing caused
several problems. If I remember right, I had to use only simple C and LEDA
strings and no InterViews strings.
Bye, Heribert (dahms@ifk20.mach.uni-karlsruhe.de)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads