Note that there are some explanatory texts on larger screens.

plurals
  1. POLinker error when user defined dll is refering another userdefined dll
    text
    copied!<p>I was trying to implement a protocol stack using Protocol Layer Design Pattern : <a href="http://www.eventhelix.com/realtimemantra/patterncatalog/protocol_layer.htm" rel="nofollow">http://www.eventhelix.com/realtimemantra/patterncatalog/protocol_layer.htm</a></p> <p>In our project,I have all the layers as separate dlls. The layers that i have are:</p> <ol> <li><p>Application Layer dll</p></li> <li><p>LLC Layer dll</p></li> <li><p>MAC Layer dll</p></li> <li><p>Physical Layer dll</p></li> </ol> <p>I have another project in the same solution which implements the Design Pattern and has the implementations of the General functionalities of a protocol Layer. All my layers are inheriting from the Protocol Layer Base class. The dependency between projects is as follows: Protocol Layer Design Pattern dll: No dependency Physical Layer dll: Protocol Design Pattern dll MAC Layer dll: Protocol Design Pattern dll and Physical Layer dll LLC Layer dll: Protocol Design Pattern dll and MAC Layer dll Application Layer dll: Protocol Design Pattern dll and LLC Layer dll</p> <p>Based on the design pattern, each of our layer has pointers to the layer above and below it. And the flow that we designed is like: In application layer constructor we create an object of LLC Layer then LLC Layer creates Mac layer and MAC layer inturn creates physical Layer. They all are linked using pointers.</p> <p>My Protocol Design Pattern project dll and Physical Layer dll builds properly. But other dll builds are giving linker error. Saying unresolved externals to the constructor of the underlying layer. These are the errors which i am getting.</p> <p>==================================</p> <blockquote> <ol> <li>1>phLayer.obj : error LNK2019: unresolved external symbol "public:<br> virtual __thiscall CProtocolLayer::~CProtocolLayer(void)"<br> (??1CProtocolLayer@@UAE@XZ) referenced in function<br> __unwindfunclet$??0CPhysicalLayer@@QAE@PAVCProtocolLayer@@@Z$0 1>phLayer.obj : error LNK2019: unresolved external symbol "public:<br> __thiscall CReceiveProtocolHandler::CReceiveProtocolHandler(class CProtocolLayer *)"<br> (??0CReceiveProtocolHandler@@QAE@PAVCProtocolLayer@@@Z) referenced in function "public: __thiscall CPhysicalLayer::CPhysicalLayer(class CProtocolLayer *)" (??0CPhysicalLayer@@QAE@PAVCProtocolLayer@@@Z) 1>phLayer.obj : error LNK2019: unresolved external symbol "public: __thiscall CTransmitProtocolHandler::CTransmitProtocolHandler(class CProtocolLayer *)"<br> (??0CTransmitProtocolHandler@@QAE@PAVCProtocolLayer@@@Z) referenced in function "public: __thiscall CPhysicalLayer::CPhysicalLayer(class CProtocolLayer *)" (??0CPhysicalLayer@@QAE@PAVCProtocolLayer@@@Z)<br> 1>phLayer.obj : error LNK2019: unresolved external symbol "public:<br> __thiscall CProtocolLayer::CProtocolLayer(class CProtocolLayer *,class CProtocolLayer *)" (??0CProtocolLayer@@QAE@PAV0@0@Z) referenced in function "public: __thiscall<br> CPhysicalLayer::CPhysicalLayer(class CProtocolLayer *)"<br> (??0CPhysicalLayer@@QAE@PAVCProtocolLayer@@@Z) 1>phLayer.obj : error LNK2019: unresolved external symbol "public: int __thiscall<br> CProtocolPacket::getBodyLength(void)"<br> (?getBodyLength@CProtocolPacket@@QAEHXZ) referenced in function<br> "public: virtual void __thiscall CPhysicalLayer::Data_req(class<br> CProtocolPacket *)"<br> (?Data_req@CPhysicalLayer@@UAEXPAVCProtocolPacket@@@Z) 1>phLayer.obj : error LNK2019: unresolved external symbol "public: void __thiscall CReceiveProtocolHandler::Handle_Receive(class CProtocolPacket *)"<br> (?Handle_Receive@CReceiveProtocolHandler@@QAEXPAVCProtocolPacket@@@Z) referenced in function "private: void __thiscall<br> CPhysicalLayer::dataRead(void)" (?dataRead@CPhysicalLayer@@AAEXXZ)<br> 1>phLayer.obj : error LNK2019: unresolved external symbol "public:<br> void __thiscall CProtocolPacket::AddTrailer(int,char *)"<br> (?AddTrailer@CProtocolPacket@@QAEXHPAD@Z) referenced in function<br> "private: class CProtocolPacket __thiscall<br> CPhysicalLayer::convertToProtocolPacket(class<br> std::basic_string,class<br> std::allocator >)"<br> (?convertToProtocolPacket@CPhysicalLayer@@AAE?AVCProtocolPacket@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>phLayer.obj : error LNK2019: unresolved external symbol "public:<br> void __thiscall CProtocolPacket::AddHeader(int,char *)"<br> (?AddHeader@CProtocolPacket@@QAEXHPAD@Z) referenced in function<br> "private: class CProtocolPacket __thiscall<br> CPhysicalLayer::convertToProtocolPacket(class<br> std::basic_string,class<br> std::allocator >)"<br> (?convertToProtocolPacket@CPhysicalLayer@@AAE?AVCProtocolPacket@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)</li> </ol> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload