bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem Compiling FTPSocket Class


From: Karol Krizka
Subject: Problem Compiling FTPSocket Class
Date: Thu, 27 Nov 2003 18:51:12 -0800

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]