Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8290511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:50:12+00:00 2026-06-08T12:50:12+00:00

i have a header file named NetworkInterfaceInfoProvider.h. in this header file i declare a

  • 0

i have a header file named NetworkInterfaceInfoProvider.h.
in this header file i declare a class as follow:

#ifndef INETWORK_INTERFACE_INFO_PROVIDER_H
#define INETWORK_INTERFACE_INFO_PROVIDER_H
#pragma once
/*#include "stdafx.h"*/
#include "IConfig.h"
#include "NetworkAddapterAddresses.h"
#include "InstaledAddapters.h"

namespace IRNetwork
{
    class CLASS_DECLSPEC INet;
    struct CLASS_DECLSPEC GenericIPAddress;
    /*
    * provide information about all network interface related adapters such as installed interfaces , addresses , best routes and ...
    * TO DO: implement Other OS's
    */
    class CLASS_DECLSPEC INetworkInterfaceInfoProvider
    {
    public:
        INetworkInterfaceInfoProvider(void);
        ~INetworkInterfaceInfoProvider(void);

        int32_t GetBestRouteTo(char* destIp,uint16_t port,ip_t *ip);
        int32_t GetBestRouteTo(GenericIPAddress* ip);
    private:
        INet* snet;
    };
}
#endif

when i want to use it in my console application i got following linker error

*note: the library of above code has been linked to my console application.
CLASS_DECLSPEC is dll import/export definition*

error LNK2019: unresolved external symbol “__declspec(dllimport)
public: int __thiscall
IRNetwork::INetworkInterfaceInfoProvider::GetBestRouteTo(char
,unsigned short,char ()[65])” (_imp?GetBestRouteTo@INetworkInterfaceInfoProvider@IRNetwork@@QAEHPADGPAY0EB@D@Z)
referenced in function “void __cdecl test_adapters(void)”
(?test_adapters@@YAXXZ) testDhcpv4.obj testDhcpv4

what is wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:50:13+00:00Added an answer on June 8, 2026 at 12:50 pm

    Hmm. From the error I would say importing looks good. So maybe there was an error while exporting. Assuming you are using Visual Studio, you can use dumpbin to check if your dll is exporting correctly:

    Open the Visual Studio Command Prompt (available from the windows start menu) and type

    dumpbin /EXPORTS yourlib.dll
    

    Then you should see our export, something like (dump from one of my dlls):

    ...
    170   A9 00108120 ??1AbstractParam@param@core@megamol@@UAE@XZ = ??1BoolParam@param@core@megamol@@UAE@XZ (public: virtual __thiscall megamol::core::param::BoolParam::~BoolParam(void))
    ...
    

    If the function your are calling is not listed, you should doublecheck if your dllexport is set correctly while building your dll.

    If the function is listed, but looks different, you should check for the calling conventions to be the same for your application and your dll.

    If the function is listed and the name looks identical to what the error message says, doublecheck if you are linking the import library of the dll correctly.

    Also check if the runtime-configuration is the same for your application and your dll (e.g. Multi-Threaded-Dll or Multi-Threaded-Debug-Dll).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a header file like this: #ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #ifdef _DEBUG //
I have a header file named Application.h where I include a header named CollisionHandler.h.
I'm not totally sure but this looks wrong: I have a header file named
I have a header file with all the enums listed (#ifndef #define #endif construct
say you have a source file named sum.c that looks like this: #include sum.h
I have a file named page.php and it is something like this; <? include
I have a header file variable.h where i declare all my global variable.Then i
I have this header file, zeeheader.h, and I wrote some classes in it, I'm
I have a header file. In this header I want to use a map
I have one map within one header file class: class One { // code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.