0

In the code it is compiling when i use float datatypes then when changing the float to double in typedef there are above linking errors.

Error   12  fatal error LNK1120: 11 unresolved externals    C:\work\eb_adasis_rc_toolbox\build\test1\Debug\executable_prj.exe
Error   2   error LNK2019: unresolved external symbol "public: virtual bool __thiscall ElementApproximator::Clothoid::GetPointListForDisplay(class std::vector<class ElementApproximator::Point,class std::allocator<class ElementApproximator::Point> > &,class std::vector<double,class std::allocator<double> > &)const " (?GetPointListForDisplay@Clothoid@ElementApproximator@@UBE_NAAV?$vector@VPoint@ElementApproximator@@V?$allocator@VPoint@ElementApproximator@@@std@@@std@@AAV?$vector@NV?$allocator@N@std@@@4@@Z) referenced in function _main  executable_prj.obj
Error   1   error LNK2019: unresolved external symbol "public: bool __thiscall ElementApproximator::Point::GetTmcXY(double &,double &)const " (?GetTmcXY@Point@ElementApproximator@@QBE_NAAN0@Z) referenced in function _main   executable_prj.obj
Error   3   error LNK2019: unresolved external symbol "public: bool __thiscall ElementApproximator::Clothoid::Init(class ElementApproximator::Point const &,double,double,double,double)" (?Init@Clothoid@ElementApproximator@@QAE_NABVPoint@2@NNNN@Z) referenced in function _main executable_prj.obj
Error   4   error LNK2019: unresolved external symbol "public: __thiscall ElementApproximator::Point::Point(double,double)" (??0Point@ElementApproximator@@QAE@NN@Z) referenced in function _main   executable_prj.obj
Error   11  error LNK2001: unresolved external symbol "public: virtual void __thiscall ElementApproximator::Element::Translate(double,double)" (?Translate@Element@ElementApproximator@@UAEXNN@Z)   executable_prj.obj
Error   10  error LNK2001: unresolved external symbol "public: virtual void __thiscall ElementApproximator::Element::Rotate(double)" (?Rotate@Element@ElementApproximator@@UAEXN@Z) executable_prj.obj
Error   9   error LNK2001: unresolved external symbol "public: virtual void __thiscall ElementApproximator::Clothoid::Translate(double,double)" (?Translate@Clothoid@ElementApproximator@@UAEXNN@Z) executable_prj.obj
Error   8   error LNK2001: unresolved external symbol "public: virtual void __thiscall ElementApproximator::Clothoid::Rotate(double)" (?Rotate@Clothoid@ElementApproximator@@UAEXN@Z)   executable_prj.obj
Error   6   error LNK2001: unresolved external symbol "public: virtual bool __thiscall ElementApproximator::Clothoid::GetTangentGridBearingAtDeltaLength(double,double &)const " (?GetTangentGridBearingAtDeltaLength@Clothoid@ElementApproximator@@UBE_NNAAN@Z)    executable_prj.obj
Error   7   error LNK2001: unresolved external symbol "public: virtual bool __thiscall ElementApproximator::Clothoid::GetPointAtDeltaLength(double,class ElementApproximator::Point &)const " (?GetPointAtDeltaLength@Clothoid@ElementApproximator@@UBE_NNAAVPoint@2@@Z)    executable_prj.obj
Error   5   error LNK2001: unresolved external symbol "public: virtual bool __thiscall ElementApproximator::Clothoid::GetCurvatureAtDeltaLength(double,double &)const " (?GetCurvatureAtDeltaLength@Clothoid@ElementApproximator@@UBE_NNAAN@Z)  executable_prj.obj

I already saw other posts regarding this error but was unable resolve it using the workarounds mentioned in the answers. Thanking you

Regards, Mrinal

mony
  • 3
  • 1
  • 6
  • 1
    This just means you haven't changed them everywhere: you've updated the declaration of the function, but not the actual implementation. – Igor Tandetnik Oct 02 '13 at 13:30
  • @IgorTandetnik- Sorry to say but i am unable to understand what you are trying to say. Actually my library is compiling without any errors but when trying to run the lib from main function this linking error appears. – mony Oct 02 '13 at 14:49
  • Could you please elaborate on what do you mean exactly by "trying to run the lib from main function"? – hege Oct 02 '13 at 19:04
  • Basically, your header file says `void f(double);` and your source file says `void f(float) {...}`. This doesn't prevent the library from compiling - it's perfectly OK to declare two functions with the same name but different parameter types (read about overloading in your favorite C++ textbook). But then you try to call `f(double)`, and it turns out that it was never implemented. There's an implementation of `f(float)`, but no one's calling it. – Igor Tandetnik Oct 02 '13 at 19:16

0 Answers0