A
A
antonyter2013-09-29 21:40:43
C++ / C#
antonyter, 2013-09-29 21:40:43

The compiler loses the implementation of the method in the library

I write a class in a static library:

class IMercatorMap : public BaseGLObject
{	
public:
  IMercatorMap() : BaseGLObject(BT_NOTHING){};
  virtual ~IMercatorMap(){};
  virtual void SetParameters(int Zoom, const iPoint &LeftBottomIndex, const iPoint &TopRightIndex) = 0;

  static IMercatorMap *Create(bool SmoothZoom);
};

And the corresponding implementation:
IMercatorMap *IMercatorMap::Create(bool SmoothZoom)
{
  return new MercatorMap(SmoothZoom);
}

As a result, I get the following error in the exe that holed this library:
error LNK2019: reference to an unresolved external symbol "public: static class ANTSP::IMercatorMap * __stdcall ANTSP::IMercatorMap::Create(bool)"

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vScherba, 2013-09-29
@antonyter

Too little data in the question, but I'll try to guess. I'm worried about __stdcall in the linker error output. It looks like the method with __cdecl is implemented and the calling code has built in a call with __stdcall calling convention.

D
Door, 2013-09-29
@Door

do

extern "C" inline IMercatorMap* Create(bool SmoothZoom)
{
    return new MercatorMap(SmoothZoom);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question