problem splitting c++ program

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2003
Posts: 1
Reputation: beginner is an unknown quantity at this point 
Solved Threads: 0
beginner beginner is offline Offline
Newbie Poster

problem splitting c++ program

 
0
  #1
Nov 22nd, 2003
Hi,

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 &)'
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: problem splitting c++ program

 
0
  #2
Nov 24th, 2003
Have you checked you include statements? Are they appropriately set, spelling and all?
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC