Click here to Skip to main content
15,897,519 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get file name from a full path Pin
Nitheesh George23-Jan-08 22:52
Nitheesh George23-Jan-08 22:52 
GeneralRe: How to get file name from a full path Pin
Rajesh R Subramanian23-Jan-08 23:32
professionalRajesh R Subramanian23-Jan-08 23:32 
QuestionHow do I get information about a URL Pin
jfmcdprof23-Jan-08 14:43
jfmcdprof23-Jan-08 14:43 
Questiondriving stepper motor Pin
Adnan Merter23-Jan-08 11:44
Adnan Merter23-Jan-08 11:44 
GeneralRe: driving stepper motor Pin
Mark Salsbery23-Jan-08 12:00
Mark Salsbery23-Jan-08 12:00 
QuestionRe: driving stepper motor Pin
David Crow24-Jan-08 3:27
David Crow24-Jan-08 3:27 
GeneralRe: driving stepper motor Pin
Adnan Merter24-Jan-08 4:09
Adnan Merter24-Jan-08 4:09 
GeneralVTable Madness [modified] Pin
73Zeppelin23-Jan-08 9:49
73Zeppelin23-Jan-08 9:49 
I'm having trouble with vtables. I have a class:

class CLatticeNode {
    public:
        CLatticeNode(void);     // Default constructor - don't call
        virtual ~CLatticeNode(void);
   
        CLatticeNode(double SpotPrice) { 
        	m_dUnderlyingPrice = SpotPrice;
        	m_dOptionValue = 0.0;
        };
        
        // access functions
        inline double GetUnderlyingPrice(void) const { return this->m_dUnderlyingPrice; };
        inline double GetOptionValue(void) const { return this->m_dOptionValue; };
        
        inline void SetUnderlyingPrice(double Price) { m_dUnderlyingPrice = Price; }; 
        inline void SetOptionValue(double Value) { m_dOptionValue = Value; };
        
    private:	
    	// these member vars hold the price data
    	double m_dUnderlyingPrice;
    	double m_dOptionValue;

};


I have a std::vector of boost pointers declared as follows:

typedef boost::shared_ptr <CLatticeNode> CLatticeNodePtr;


and a vector of vectors:

std::vector< std::vector<CLatticeNodePtr> > Tree;


I'm trying to call the member function GetUnderlyingPrice as follows:

Tree[col].push_back(CLatticeNodePtr(new CLatticeNode((Tree[col-1][row])->GetUnderlyingPrice() * m_dU)));

Basically I'm trying to access the CLatticeNode member function GetUnderlyingPrice via
the call:
Tree[col-1][row]->GetUnderlyingPrice()


But on compile, I consistently get:

g++ -L/usr/local/boost-1.34.1 -o "AMMPricer"  ./AMMPricer.o ./LatticeClass.o ./TrinomialTree.o   
/usr/bin/ld: Undefined symbols:
vtable for CLatticeNode
collect2: ld returned 1 exit status
make: *** [AMMPricer] Error 1


Is this a linker error or have I got something wrong in the class definition?










modified on Wednesday, January 23, 2008 3:57:49 PM

QuestionRe: VTable Madness Pin
Maximilien23-Jan-08 10:31
Maximilien23-Jan-08 10:31 
GeneralRe: VTable Madness Pin
73Zeppelin23-Jan-08 10:39
73Zeppelin23-Jan-08 10:39 
GeneralRe: VTable Madness Pin
Jim Crafton23-Jan-08 12:02
Jim Crafton23-Jan-08 12:02 
GeneralRe: VTable Madness Pin
73Zeppelin23-Jan-08 19:26
73Zeppelin23-Jan-08 19:26 
GeneralSolution! Pin
73Zeppelin23-Jan-08 20:03
73Zeppelin23-Jan-08 20:03 
GeneralRe: Solution! Pin
Rajesh R Subramanian23-Jan-08 22:24
professionalRajesh R Subramanian23-Jan-08 22:24 
GeneralRe: Solution! Pin
Jim Crafton24-Jan-08 3:23
Jim Crafton24-Jan-08 3:23 
GeneralRe: Solution! Pin
73Zeppelin24-Jan-08 3:39
73Zeppelin24-Jan-08 3:39 
Questionc/c++ binary to string and vice versa conversion functions? Pin
mindspin31123-Jan-08 5:02
mindspin31123-Jan-08 5:02 
AnswerRe: c/c++ binary to string and vice versa conversion functions? Pin
David Crow23-Jan-08 5:26
David Crow23-Jan-08 5:26 
QuestionRe: c/c++ binary to string and vice versa conversion functions? Pin
CPallini23-Jan-08 5:32
mveCPallini23-Jan-08 5:32 
GeneralRe: c/c++ binary to string and vice versa conversion functions? Pin
David Crow23-Jan-08 5:40
David Crow23-Jan-08 5:40 
JokeOK! Pin
CPallini23-Jan-08 5:52
mveCPallini23-Jan-08 5:52 
GeneralView Console Window Pin
gman200823-Jan-08 3:17
gman200823-Jan-08 3:17 
QuestionRe: View Console Window Pin
David Crow23-Jan-08 3:37
David Crow23-Jan-08 3:37 
GeneralRe: View Console Window Pin
gman200823-Jan-08 3:40
gman200823-Jan-08 3:40 
QuestionRe: View Console Window Pin
David Crow23-Jan-08 4:30
David Crow23-Jan-08 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.