[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem Compiling FTPSocket Class
From: |
Federico Montesino Pouzols |
Subject: |
Re: Problem Compiling FTPSocket Class |
Date: |
Sat, 29 Nov 2003 13:09:06 +0100 |
User-agent: |
Mutt/1.5.4i |
Hi, you should not enter these flags by hand, but use the
output of the ccgnu2-config script that is installed with cc++. Try
'ccgnu2-config --help' to see the options. You will need to use
something like `ccgnu2-config --flags --libs --extlibs` which will
give something similar to the flags you are specifying by hand, but
tailored for your system.
On Thu, Nov 27, 2003 at 06:51:12PM -0800, Karol Krizka wrote:
> Hello!
>
> I am a newbie at using CommonC++, and I run into several problems. First
> was how to compile the programs, but I found a fix after a long search. I
> had to add the following when compiling:
> -L/usr/lib -D_REENTRANT -D_THREAD_SAFE -g -O2 -D_GNU_SOURCE -lpthread
> /usr/lib/libccext2.a /usr/lib/libccgnu2.a
> Then when I played around with the FTP class, I run into more compiling
> problems:
> /tmp/cc5BNOu1.o(.text+0xc9): In function `main':
> /usr/include/cc++/socket.h:1451: undefined reference to
> `ost::FTPSocket::FTPSocket[in-charge](ost::InetHostAddress,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
> unsigned long)'
> /tmp/cc5BNOu1.o(.text+0x142): In function `main':
> /usr/include/c++/3.2.3/bits/basic_string.h:338: undefined reference to
> `ost::FTPSocket::pwd()'
> /tmp/cc5BNOu1.o(.text+0x1c1): In function `main':
> /usr/include/c++/3.2.3/bits/stl_alloc.h:668: undefined reference to
> `ost::FTPSocket::~FTPSocket [in-charge]()'
> /tmp/cc5BNOu1.o(.text+0x3bf):/usr/include/c++/3.2.3/bits/stl_alloc.h:668:
> undefined reference to `ost::FTPSocket::~FTPSocket [in-charge]()'
> collect2: ld returned 1 exit status
> make: *** [ftp] Error 1
>
> I am at a loss here, and have no idea what to do. Can anyone help me? I
> attached the program at the end of the email.
>
> CHEERS
> --RoadkillBunny
>
> CODE ftp.cpp
> -------------------------------------------------
> #include <cc++/ftp.h>
> #include <cc++/socket.h>
> #include <iostream>
> #include <unistd.h>
> #include <string.h>
>
> using namespace std;
> using namespace ost;
>
> int main(int argc,char* argv[]) {
> // if(argc!=2) {
> // cout << "Usage: myftp server" << endl;
> // exit(0);
> //}
>
> string user;
> string passwd;
>
> cout<<"Username: "; cin>>user;
> cout<<"Password: "; cin>>passwd;
> InetHostAddress h1("localhost");
> FTPSocket ftp1(h1,user,passwd,100);
> string pwd;
>
> pwd=ftp1.pwd();
> cout<<"PWD: "<<pwd<<endl;
> return 0;
> }
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp