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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:20:55+00:00 2026-06-09T13:20:55+00:00

I have a .cpp and a header in another project that I’d like to

  • 0

I have a .cpp and a header in another project that I’d like to link to. I’ve added the header and placed the .lib file in the Linker/ Input/ Additional Dependencies but I get an unresolved external. From what I read this could be because the lib is part of a dll project. All I want to do is link to the obj of that class, but it doesn’t appear to want to let me do that. I can link to another lib file in the same directory so it’s not a path issue.

I could probably export the class as part of a DLL, but I don’t want the worry of memory leaks as I would have to pass a pointer to the object, whereas if I link directly, I don’t have to worry about it at all.

How’s the best way to diagnose if I can link to the lib file.

Is there any particular reason VS2010 won’t let me go directly to the obj file? This would seem to be the easiest option.

Thanks,
James

  • 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-09T13:20:57+00:00Added an answer on June 9, 2026 at 1:20 pm

    If you want to link directly to the .obj file of the class, you will have to add the .cpp file of the class to your project. This, however easier it may seem, is not a solution to your problem, only a workaround. I cannot think of how to solve the problem, though.

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

Sidebar

Related Questions

I have a file Cache.cpp that has a corresponding header file Cache.h and another
I have a c++ implementation file (my.cpp) that indirectly includes a header file (b.h)
I have a very simple C++ file Multiplier.cpp with the corresponding header file, from
I have three files: movie.h (header); movie.cpp (implementation file); lab9.cpp (driver file using movie
I have a file SpreadSheetCell.h and SpreadSheetCell.cpp. I have another file SpreadSheet.cpp which includes
Basically I have code which looks like this inside a header file: class Bar;
I have a .cpp source file that contains both C and C++ code. The
I have a struct defined in a header file with three other files that
I have a header file a.h and inside that I have declared one structure.
I have a namespace defined in one header file and used in another, but

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.