problem with MS visual c++ linking

Home Forums Discussions Support Portal problem with MS visual c++ linking

This topic contains 4 replies, has 3 voices, and was last updated by  Wyatt 13 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4871

    Wyatt
    Participant

    Anyone,

    I tried to compile the source in the MSVC directory of the trial version and I’m getting a linker mismatch problem. output from MSVC compiler is below:

    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __thiscall CNdisApi::CNdisApi(char const *)” (__imp_??0CNdisApi@@QAE@PBD@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: virtual __thiscall CNdisApi::~CNdisApi(void)” (__imp_??1CNdisApi@@UAE@XZ)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::FlushAdapterPacketQueue(void *)” (__imp_?FlushAdapterPacketQueue@CNdisApi@@QAEHPAX@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::SetAdapterMode(struct _ADAPTER_MODE *)” (__imp_?SetAdapterMode@CNdisApi@@QAEHPAU_ADAPTER_MODE@@@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::SetPacketEvent(void *,void *)” (__imp_?SetPacketEvent@CNdisApi@@QAEHPAX0@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::SendPacketToMstcp(struct _ETH_REQUEST *)” (__imp_?SendPacketToMstcp@CNdisApi@@QAEHPAU_ETH_REQUEST@@@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::SendPacketToAdapter(struct _ETH_REQUEST *)” (__imp_?SendPacketToAdapter@CNdisApi@@QAEHPAU_ETH_REQUEST@@@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::ReadPacket(struct _ETH_REQUEST *)” (__imp_?ReadPacket@CNdisApi@@QAEHPAU_ETH_REQUEST@@@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::GetTcpipBoundAdaptersInfo(struct _TCP_AdapterList *)” (__imp_?GetTcpipBoundAdaptersInfo@CNdisApi@@QAEHPAU_TCP_AdapterList@@@Z)
    PassThru.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: int __thiscall CNdisApi::IsDriverLoaded(void)” (__imp_?IsDriverLoaded@CNdisApi@@QAEHXZ)
    Debug/PassThru.exe : fatal error LNK1120: 10 unresolved externals
    Error executing link.exe.

    PassThru.exe – 11 error(s), 0 warning(s)

    Does anyone know what’s missing/wrong? Thank you already.

    #5620

    Manpreet Singh
    Participant

    make sure that you have following lib files

    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    #5621

    Wyatt
    Participant

    I verified that my computer does have all those libraries. However upon further look, I determined that there were function prototypes for NDisApi functions like “ReadPacket” but not function definitions. I wrote to Serpentfly and he told me that the definitions were in ndisapi.dll. Most of the folders (bin/Cbuilder/kernel) have a ndisapi.dll file in them but the MSVC folder does not. So I copied ndisapi.dll into the MSVC folder (still trying to get the MSVC version to compile) and added an include statement on ndisapi.h to include the ndisapi.dll. Unfortunately this gave me different errors, however the original problem of the “unresolved external symbols” is gone. How should the program link to ndisapi.dll? I’ll review the other folders/files and maybe I can figure it out.

    #5622

    Vadim Smirnov
    Moderator

    You should link ndisapi.lib.

    #5623

    Wyatt
    Participant

    Thank you Serpent Fly. I had to link to ndisapi.lib and then add ndisapi.dll to my path (I chose inside the projects debug folder). She is running, and that is a relief.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.