| | |
problem splitting c++ program
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2003
Posts: 1
Reputation:
Solved Threads: 0
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 &)'
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 &)'
![]() |
Similar Threads
- Random Number Problem For Lottery Program (Visual Basic 4 / 5 / 6)
- Finding the maximum number from a number list (JavaScript / DHTML / AJAX)
- simultaneous MS Access Database access problem using VB6 program. (Visual Basic 4 / 5 / 6)
- problem relating to c program.... (IT Professionals' Lounge)
- client server communication problem in CSocket program (C)
- a problem wilth C program (C)
Other Threads in the C++ Forum
- Previous Thread: Learn before asking!!!!!
- Next Thread: compiling problems
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





