VS2005 C++: strange linking problem

I have some strange linking problem in my Visual Studio 2005 C++ project. As always, I declare class in a header and define it's methods in cpp. A have all these files included in my project. And I still have the unresolved external symbol calcWeight. It appears if I actually use this class in my main function. calcWeight() is declared as virtual in the parent class CHDRGenerator If I comment a code in cpp and define calcWeight in a class body, it works fine. But i really don't like this magic. Can someone help?

Here is the part of a code:

#include "stdafx.h"
#include "simple.h"

class CHDRGenerator_Mann_Pickard : public CHDRGenerator
    /// @name Constructors
    /// @{
    /// @brief a constructor using prepared imaged sequence
    CHDRGenerator_Mann_Pickard(CSimpleImageFile * imSeq, int seqL) : CHDRGenerator(imSeq, seqL)

    /// @brief a constructor using filenames
    CHDRGenerator_Mann_Pickard(std::string * filenames, int seqL) : CHDRGenerator(filenames, seqL)

    /// @brief a constructor, CFileNameSequence object parameter
    CHDRGenerator_Mann_Pickard(CFileNameSequence & const fileseq) : CHDRGenerator(fileseq)
    /// @}

    inline double calcWeight(double val);

#include "mann-pickard.h"
//=======================Class CHDRGenerator_Mann_Pickard methods=====================//


inline double CHDRGenerator_Mann_Pickard::calcWeight(double val)
    const double gamma = 2.2f;
    return gamma * pow(val, gamma - 1);
//=====================End of Class CHDRGenerator_Mann_Pickard methods=================//

"simple.h" is a header with CHDRGenerator class implementation. I know it should work...as it always worked. Maybe I have some stupid hard-to-find mistake?..


What happens if you remove "inline" from your declaration and definition of calcWeight?

Need Your Help

Jquery - save class state for multiple div #'s to a cookie?

jquery click cookies save

I'm trying to replicate a UI effect as on http://mcfc.co.uk I have written a script that hides a div on click function and applies a class to a div with the #id corresponding to the div that was cl...

Alternative to PhantomJS for Testing

javascript testing phantomjs

I'm currently trying to build a little testing suite for CI (Hudson). I've written a complex script which dynamically invokes other Scripts and populates a given DIV element.