help-gplusplus
[Top][All Lists]
Advanced

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

compile error when using selfcode .h file


From: fsshl
Subject: compile error when using selfcode .h file
Date: 26 Sep 2005 21:07:13 -0700
User-agent: G2/0.2

I am in g++ or gcc 3.4.4 (tested on both linux ubuntu kernel 3.6.8 and
cygwin 1.5.18-1 dll on window xp-sp2)

I like to test and using the following .h (lib? I do not know yet to
make it become lib)

http://www.cs.duke.edu/~ola/ap/code/apstring.h

by simple test program
-------------------------------------------------------
#include <iostream>
#include "/home/eric/apstring.h"

using namespace std;

int main() {

apstring name;

cout << "Enter your last name: " << endl;
cin >> name;
cout << name;

  return 0;

}
---------------------------------------------------------------
but compiler response error
----------

$ g++   pg88.C -o pg88
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h:31,
                 from /home/eric/apstring.h:4,
                 from pg88.C:4:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one deprecated or
antiquated header. Please consider using one of the 32 headers found in
section 17.4.1.2 of the C++ standard. Examples include substituting the
<X> header for the <X.h> header for C++ includes, or <iostream> instead
of the deprecated header <iostream.h>. To disable this warning use
-Wno-deprecated.
/cygdrive/c/DOCUME~1/ERICLI~1/LOCALS~1/Temp/ccKePRMx.o:pg88.C:(.text+0x167):
undefined reference to `apstring::apstring()'
/cygdrive/c/DOCUME~1/ERICLI~1/LOCALS~1/Temp/ccKePRMx.o:pg88.C:(.text+0x1a5):
undefined reference to `operator>>(std::basic_istream<char,
std::char_traits<char> >&, apstring&)'
/cygdrive/c/DOCUME~1/ERICLI~1/LOCALS~1/Temp/ccKePRMx.o:pg88.C:(.text+0x1b8):
undefined reference to `operator<<(std::basic_ostream<char,
std::char_traits<char> >&, apstring const&)'
/cygdrive/c/DOCUME~1/ERICLI~1/LOCALS~1/Temp/ccKePRMx.o:pg88.C:(.text+0x1ca):
undefined reference to `apstring::~apstring()'
/cygdrive/c/DOCUME~1/ERICLI~1/LOCALS~1/Temp/ccKePRMx.o:pg88.C:(.text+0x1f4):
undefined reference to `apstring::~apstring()'
collect2: ld returned 1 exit status
-------------------------------------------------------------

  thanks in advance any advancer's advice or help
charles



reply via email to

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