On Sat, 7 Aug 1999, Micha Feigin wrote: > Date: Sat, 07 Aug 1999 13:48:48 +0300 (GMT+0300) > From: Micha Feigin <[EMAIL PROTECTED]> > To: Debian-user <Debian-user@lists.DEBIAN.org> > Subject: c++ include problem (preprocessor directives) > Resent-Date: Sat, 07 Aug 1999 10:45:21 +0000 > Resent-From: debian-user@lists.DEBIAN.org > Resent-cc: recipient list not shown: ; > > In my files the headers are included like this: > #ifdef NEWCPPH > #include <iostream> > #else > #include <iostream.h> > #endif > > #include <cassert> > #include <cstring> > #include "input.h" > > only then i get an error that the functions declared inside input.h can't > be found. The linker says: > g++ -o main.o -Wall -pedantic -c main.cpp > g++ main.o -o main > main.o: In function `main': > main.o(.text+0x16): undefined reference to `input(void)' > main.o(.text+0x8a): undefined reference to `input(char const *)' > collect2: ld returned 1 exit status > make: *** [main] Error 1 > > what am i doing wrong?
learn about C++ name mangling extern "C" is your friend > > thanx > [EMAIL PROTECTED] > > > -- > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null > > Oleg Krivosheev, MS 220, BD/Physics, Fermi National Accelerator Laboratory, P.O.Box 500, Batavia, Illinois, 60510 phone: (630) 840 8460 FAX : (630) 840 6039 Email: [EMAIL PROTECTED]