• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering.
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Coming soon.
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models.

Resolving undefined references

Quasar Chunawala

Active Member
Hi,

I am trying to model points in the [TEX]{R}^{2}[/TEX] in a C++ program - chapter 4 of Introduction to C++ for financial engineers. I am working on Ubuntu - gc++ compiler with Eclipse as the IDE.

While building the project, the compilation works good. The linker throws an undefined reference error.

Building target: PointDemo
Invoking: GCC C++ Linker
g++ -o "PointDemo" ./Point.o ./TestPoint.o
./Point.o: In function `Point:: Point()':
/home/quasar/workspace/PointDemo/Debug/../Point.cpp:14: undefined reference to `vtable for Point'

Do the arguments to g++ -o need to supplied in a specific order?

I apologize that the question is not pertaining to C++ syntax as such, but rather a configuration issue. I googled, but I can't resolve the error.
 
Last edited:

Daniel Duffy

C++ author, trainer
It's a question of knowing the compilation and linking processes.

Code looks like verbatim copy. What happened to author's copyright?
 
Last edited:

Daniel Duffy

C++ author, trainer
No problem.

edit: Anyways, the whole point about programming is to spend as long as it takes to solve compiler problems. You cannot expect others to debug your code for you.

Maybe take a simpler example.
 
Last edited:
Top