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 1056855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:46:36+00:00 2026-05-16T17:46:36+00:00

I just have a problem that I have been trying to fix for the

  • 0

I just have a problem that I have been trying to fix for the longest time.

I have a static library project in visual c++, and I want another project to be able to link to it. Up until now, I have simply been adding a reference to the static library project, which automatically links the library.

I want to be able to link to the library using only the header files and the .lib file. However, I get a “Unresolved external symbol” error.

I thought I was doing it right – I specified the include directory, the library directory, and went into the linker input properties and provided the lib as an additional dependency.

I am able to reference other static libraries this way (like SDL), so why do I get errors when I try to reference mine?

Thanks for the help.

Is the problem that its not referencing the actual lib file, or is something within the lib itself?
These are the error messages I get:

Error 2 error LNK2019: unresolved external symbol “public: void __thiscall XEngine::XCore::XScreen::init(class XEngine::XCore::XGame &)” (?init@XScreen@XCore@XEngine@@QAEXAAVXGame@23@@Z) referenced in function “void __cdecl XEngine::XEngineInit(class XEngine::XCore::XScreen &,class XEngine::XCore::XGame &)” (?XEngineInit@XEngine@@YAXAAVXScreen@XCore@1@AAVXGame@31@@Z) C:\Users\Xander Masotto\Documents\Visual Studio 2010\Projects\Pong\Pong\source.obj Pong

Error 3 error LNK2019: unresolved external symbol “public: __thiscall XEngine::XCore::XScreen::~XScreen(void)” (??1XScreen@XCore@XEngine@@QAE@XZ) referenced in function “void __cdecl XEngine::XEngineInit(class XEngine::XCore::XGame &)” (?XEngineInit@XEngine@@YAXAAVXGame@XCore@1@@Z) C:\Users\Xander Masotto\Documents\Visual Studio 2010\Projects\Pong\Pong\source.obj Pong

Error 4 error LNK2019: unresolved external symbol “public: __thiscall XEngine::XCore::XScreen::XScreen(void)” (??0XScreen@XCore@XEngine@@QAE@XZ) referenced in function “void __cdecl XEngine::XEngineInit(class XEngine::XCore::XGame &)” (?XEngineInit@XEngine@@YAXAAVXGame@XCore@1@@Z) C:\Users\Xander Masotto\Documents\Visual Studio 2010\Projects\Pong\Pong\source.obj Pong

  • 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-16T17:46:37+00:00Added an answer on May 16, 2026 at 5:46 pm

    Make sure that you are exporting the functions, classes, and variables in your library that you want exposed to other applications (i.e. your dll or exe). By default they are not exposed.

    The ground work to do this is typically layed out when you create the project for your library.

    #ifdef TESTLIB_EXPORTS
    #define TESTLIB_API __declspec(dllexport)
    #else
    #define TESTLIB_API __declspec(dllimport)
    #endif
    

    With the code above generated during project creation there are only two more things for me to do to expose functions,classes, or variables:

    1) Make sure that I have TESTLIB_EXPORTS defined as a preprocessor. Project settings: C++/Preprocessor/PreprocessorDefinitions

    2) Use the TESTLIB_API define on each function,class, or variable i want exposed:

    class TESTLIB_API Order {
        void doSomething();
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started learning Erlang and am trying out some Project Euler problems
I have been trying to solve this strange problem with a website I am
Ok so I have been trying to fix this for days, and I'm not
I've just started to use linq to sql and have run into a problem
I've recently decided that I just have to finally learn C/C++, and there is
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have just inherited a server application, however it seems that the only copy
I have just installed C# for the first time, and at first glance it
I have been trying to load a text file into a combobox, and then
I have been trying to register 3 hotkeys. I followed this example (or this

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.