Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
I'm having some trouble compiling the program with string::find() using LEDA lib.
I got this error message during compilation
g++ -c -DDB_ORACLE -D__sun -Wall -Wstrict-prototypes -g -I../../include -I../../sql -I/vobs/prod/libs/comptellibs/include -I/vobs/prod/comptel/include -I/vobs/prod/external/include -I. ftm.cc -o SunOS/ftm.o
ftm.cc: In function `int main(int, char **)':
ftm.cc:777: no member function `leda_string::find(char[2])' defined
ftm.cc:780: no member function `leda_string::size()' defined
ftm.cc:782: no member function `leda_string::size()' defined
ftm.cc:782: no member function `leda_string::size()' defined
*** Error code 1
clearmake: Error: Build script failed for "SunOS/ftm.o"My source code is
#include
#include
#include
#include
#include
#include
#include
#include
#include
#includestring host;
string port;forall(host, server.FTCDHosts){
// ftcd_hosts may consist of port number, separate the host and port with a colon
int i;
i = host.find(":");
if (i != -1) {
//port.assign(host, i+1, host.size());
port.assign(host, i+1, host.size());
server.FtcdPort = port;
host.assign(host, 0, host.size() - port.size() -1);
} else {
server.FtcdPort = ftcd_port;
}
}Thank You
Regards,
Edwin

My first guess would be that the LEDA library isn't being linked in. I would expect to see -L and/or -l parameters in your g++ command.
-L tells the compiler (linker) another directory to look in when looking for libraries (in addition to the directories it already knows). This is the library equivalent of the -I for include files.
-l tells the compiler (linker) what specific library to look for.
So if your LEDA lib was located at /usr/lib/leda/libleda.a, you would add-L/usr/lib/leda -lleda
For the -L you add the path of the directory that library is located in and for the -l you strip the leading 'lib' and trailing '.a' from the library file name.
You specify only one directory or library with each -L and -l. So if you have five libraries spread between two different directories, you'd have two -L and five -l in your g++ command.

![]() |
g++
|
need to create a firewall...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |