Which version of the compiler are you using ?
It says it is unable to find the constructor defintion.
Are there some more messages ?
Does placing :
AT_UrlParser qservice("
http://test.com/test/test.html");
on line 93 change the error ?
Hi,
Here is the relevant code:
---begin---
//Includes
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <at_url_parse.h>
using namespace std;
<snip>
int getnodes (char service[]) //service is a URL
{
<snip>
string host;
string path;
//AT_UrlParser parsedservice(service); //This is my original line
AT_UrlParser qservice("
http://test.com/test/test.html"); //This is your suggested line - neither works
host = qservice.m_host;
path = qservice.m_path;
<snip>
}
---end---
The relevant header is 'at_parse_url.h', see thread 'Splitting URLs' in
this group. My compiler messages are below (these are from the
compilation of the code exactly as it is above):
(I am using an IDE (Anjuta) so the compiler messages are not pretty...)
---begin---
<skipping useless make messages>
Making all in src
make[2]: Entering directory `/home/pcoleman/Projects/CECID/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -Wall -O1 -g -g -O2 -MT cecid-main.o -MD -MP -MF ".deps/cecid-main.Tpo" \
-c -o cecid-main.o `test -f 'main.cc' || echo './'`main.cc; \
then mv ".deps/cecid-main.Tpo" ".deps/cecid-main.Po"; \
else rm -f ".deps/cecid-main.Tpo"; exit 1; \
fi
In file included from main.cc:16:
at_url_parse.h: In constructor `AT_UrlString::AT_UrlString(const std::string&)':
at_url_parse.h:33: warning: base initializer for `std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
at_url_parse.h:33: warning: will be re-ordered to precede member initializations
In file included from main.cc:16:
at_url_parse.h:164:29: warning: no newline at end of file
main.cc: In function `int buildlist()':
main.cc:48: warning: unused variable `int dc'
/bin/sh ../libtool --mode=link g++ -g -O2 -o cecid cecid-main.o
g++ -g -O2 -o cecid cecid-main.o
cecid-main.o(.text+0x403): In function `getnodes(char*)':
/home/pcoleman/Projects/CECID/src/main.cc:94: undefined reference to `AT_UrlParser::AT_UrlParser[in-charge](char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: ld returned 1 exit status
make[2]: *** [cecid] Error 1
make[2]: Target `all' not remade because of errors.
make[2]: Leaving directory `/home/pcoleman/Projects/CECID/src'
make[2]: Entering directory `/home/pcoleman/Projects/CECID'
make[2]: Leaving directory `/home/pcoleman/Projects/CECID'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pcoleman/Projects/CECID'
make: *** [all] Error 2
---end---
and heres my output from 'g++ -v'...:
---begin---
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
gcc version 3.2.2
---end---
....so I hope that helps.
Thanks for the assistance,
Patrick