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

  • Home
  • SEARCH
  • 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 3220370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:45:13+00:00 2026-05-17T15:45:13+00:00

Our project is a VS2008 based project using Boost and Qt heavily. However, today

  • 0

Our project is a VS2008 based project using Boost and Qt heavily. However, today we have a new linking problem that doesn’t make any sense.

What is happening is that during the link

  • For program A, our static library Foobar is finding links to 5 of the 8 member functions.
  • For program FoobarUnitTest, everything from Foobar links and runs fine.
  • For program B, our library Foobar2 is a DLL. During the link, it finds all of the member functions except for the constructor and destructor.

When I say the linker finds some of the member functions, what I did was link with /VERBOSE option on. I then went and examined the resulting buildlog.htm file and I could see where the linker was finding some of the functions from the libraries. Linker error is `”error LNK2019: unresolved external”

Also, the same thing happens in 32bit or 64bit – debug or release mode.

Any suggestions as to where to look?

  • 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-05-17T15:45:13+00:00Added an answer on May 17, 2026 at 3:45 pm

    Hard to give any meaningful advice for such a nebulous question but here are a couple things to check out. The linker reports “unresolved externals” when the header says there’s a function named “x::y()” but it can’t find that function in the lib file. Keep in mind that this assumes you have in fact implemented the functions in question. Ultimately however, whatever the problem ends up being, it will be some morphing of “you told me there’s a function named x::y(), but then you didn’t implement a functon named x::y().”

    So, step zero is make sure you actually have implemented these functions. OK, lets assume you have.

    Step 1 is make sure you are declspec(__dllexport)ing the functions in the library’s implementation, and declspec(__dllimport)ing the functions on the client side. I use macros for this:

    MyFancyLib.h:

    #ifndef MYLIB_API
    #  define MYLIB_API (declspec(__dllimport))
    #endif
    
    MYLIB_API void DoIt();
    

    MyFancyLib.CPP:

    // this should be moved to stdafx.h or something sufficiently low-level
    #define MYLIB_API (declspec(__dllexport))
    
    MYLIB_API void DoIt()
    {
      // magic happens
    }
    

    Step 2: Make sure you’ve really named things properly in the implementation. One of my most common mistakes is to declare a member function of a class or namespace, say namespace Foo { void DoIt(); };, and then forget to fully-qualify the class or namespace in the implementation. If you never call the function in your implementation, the linker may never look for it.

    MyLib.h:

    namespace lib
    {
      MILIB_API void DoIt();
    };
    

    MyLib.cpp:

    MYLIB_API void DoIt()
    {
      // magic happens
    };
    

    This will generate an unresolved external. The CPP should look like this:

    MyLibCorrect.cpp:

    MYLIB_API void mylib::DoIt()
    {
      // magic
    }
    

    Step 3: Make sure you’re linking to everything you need to link to. This might seem more like step-0 or step-1, but assuming you’ve linked to everything you think you need, this step can be hard. Look through the names the linker is complaing about, do some undecoration of them and search your library’s code for the implementation of those functions. You may find they are exported from a project other than the one you think they’re exported from.

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

Sidebar

Related Questions

In our project we have requirement that, after receiving sms message from third party
In our project we have a requirement that when a set of records are
I have upgraded my solution from VS2008. In our web project there are 2
I have created a new VS2008 ASP.Net Web service project, with the default name
We code in C# using VS2008 SP1. We have a server that runs Team
VS2008/C# newbie here. If I open our project, have no code files open, and
After upgrading our VS2008 Project to VS2010 we found that VS would take 60
Our project is using a nightly backup application that simply makes a duplicate of
We are using a Cab Builder project in VS2008 to generate our CF cab
In our project we're mixing xml and annotations based spring mvc security configuration. We've

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.