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

c++ include problem (preprocessor directives)



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?

thanx
michf@math.tau.ac.il


Reply to: