Answered Link error MicroSoft Visual C++ V6

  • Wednesday, May 16, 2012 11:44 PM
     
     

    TBillingSchedule.obj : error LNK2001: unresolved external symbol "public: void __thiscall TBillingRegister::CalculateSpread(short const &)" (?CalculateSpread@TBillingRegister@@QAEXABF@Z)
    Debug/CorCE30D.dll : fatal error LNK1120: 1 unresolved externals

    Method is defined in TBillingRegister.h

    public:

     void    CalculateSpread( const VARIANT_BOOL& bResetOnly = VARIANT_FALSE );

    Called in TBillingSchedule.cpp

    pBill->CalculateSpread(VARIANT_FALSE);

    What is wrong with this?

All Replies

  • Wednesday, May 16, 2012 11:51 PM
     
     Answered

    On 5/16/2012 7:44 PM, sturm254 wrote:

    TBillingSchedule.obj : error LNK2001: unresolved external symbol "public: void __thiscall TBillingRegister::CalculateSpread(short const&)" (?CalculateSpread@TBillingRegister@@QAEXABF@Z<mailto:?CalculateSpread@TBillingRegister@@QAEXABF@Z>)
    Debug/CorCE30D.dll : fatal error LNK1120: 1 unresolved externals

    Method is defined in TBillingRegister.h

    public:

      void    CalculateSpread( const VARIANT_BOOL&  bResetOnly = VARIANT_FALSE );

    Called in TBillingSchedule.cpp

    pBill->CalculateSpread(VARIANT_FALSE);

    What is wrong with this?

    You have a declaration of the method, and you are calling the method, but you are missing the third part - the actual code implementing the method.


    Igor Tandetnik

  • Thursday, May 17, 2012 12:57 AM
     
     

    The implementation is in TBillingRegister.cpp

    void TBillingRegister::CalculateSpread( const VARIANT_BOOL& bResetOnly )

  • Thursday, May 17, 2012 2:57 AM
     
     Answered

    sturm254 wrote:

    The implementation is in TBillingRegister.cpp

    void TBillingRegister::CalculateSpread( const VARIANT_BOOL& bResetOnly  )

    Check that TBillingRegister.cpp is actually added to the project, that  the method definition is not being #ifdef-ed away - that sort of thing.  Somehow or other, the method implementation is not being made available  to the linker.


    Igor Tandetnik

  • Friday, May 25, 2012 5:23 PM
     
     
    That was problem TBillingRegister.cpp was not added to the project.  Thanks for you help.