Compiling/Linking problem
Emmanuel Lambert
Emmanuel.Lambert@advalvas.be
Fri Nov 12 09:10:00 GMT 1999
Hi,
I have 3 classes :
1) CGSolver in files cgsolver.cc and cgsolver.h
2) CGSolverForMCL, which inherits fromCGSolver, in files cgslvrfr.cc and
cgslvrfr.h
3) MCL, which uses CGSolverForMCL, in files mcl.cc and mcl.h
I was able to compile these classes successfully using
g++ -c
My main program constructs an MCL class and is contained in the file
mcltrain.cc
Now, when I try to compile the main program and link everything using this
command :
g++ mcltrain.cc
I get several errors.
This is my screen output :
----------------------------------------------------
archytas> g++ mcltrain.cc
Undefined first referenced
symbol in file
CGSolver type_info node /esat/archytas/tmp/ccWTRpHe.o
CGSolver::~CGSolver(void) /esat/archytas/tmp/ccWTRpHe.o
CGSolver::CGSolver(int, long, double *, double)/esat/archytas/tmp/ccWTRpHe.o
CGSolver::CGSolver(void) /esat/archytas/tmp/ccWTRpHe.o
CGSolver type_info function /esat/archytas/tmp/ccWTRpHe.o
CGSolver::solve(void) /esat/archytas/tmp/ccWTRpHe.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
archytas>
----------------------------------------------------
What is the problem ?
I do not understand at all why this does not compile and link.
It works fine under Win98 and Borland C++.
Please help me out.
Thank you
Emmanuel Lambert
More information about the Gcc-help
mailing list