I am currently working on a program that compiles fine and runs OK to give some results. However, when I try to split the program into 3 parts, it it gives some weird compilation errors. Initially I had one program, calc.cpp that manipulates polynomials (adds/ subtract/multiply them). However when I split the program into three, polynomial.h, polynomial.cpp and calc.cpp I get complilation errors. Calc.cpp has polynomial.h included. Yet, when I call functions from polynomial.h it gives the following errors like it can't find the functions from polynomial.h. getpoly, add, compare, print are all functions in polynomial.h that I am trying to call. Any help would be appreciated. I can send the code if you would like to see it. I'm really stuck here...help!!

Errors on the compiler and linker output:
C:\DOCUME~1\saffyy\LOCALS~1\Temp\ccgVcaaa.o(.text+0x54f):calc.cpp: undefined reference to `getpoly(basic_string<char, string_char_traits<char>, __default_alloc_template<0, 0> >, list<polyInfo, allocator<polyInfo> > &, bool &)'
C:\DOCUME~1\saffyy\LOCALS~1\Temp\ccgVcaaa.o(.text+0x5c0):calc.cpp: undefined reference to `compare(polyInfo const &, polyInfo const &)'
C:\DOCUME~1\saffyy\LOCALS~1\Temp\ccgVcaaa.o(.text+0x8a6):calc.cpp: undefined reference to `add(list<polyInfo, allocator<polyInfo> > const &, list<polyInfo, allocator<polyInfo> >)'
C:\DOCUME~1\saffyy\LOCALS~1\Temp\ccgVcaaa.o(.text+0xaec):calc.cpp: undefined reference to `print(list<polyInfo, allocator<polyInfo> > const &)'

13 Years
Discussion Span
Last Post by Paladine
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.