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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:56:21+00:00 2026-06-02T19:56:21+00:00

So I have my solution file here, which contains 4 projects. Project A is

  • 0

So I have my solution file here, which contains 4 projects.

  • Project A is a library which gets compiled into a .lib.
  • Project B is a program which becomes an .exe.

I have set up Project A as dependency for Project B, and I included

#pragma comment(lib,"terrain.lib")

into the file in Project B which uses the library.

In spite of both projects being compiled into the same Debug / Release folder, MSVCC tells me

1>LINK : fatal error LNK1104: File "terrain.lib" could not be opened.
// <freely translated from German, could mean "not found">

This:

#pragma comment(lib,"../Debug/terrain.lib")

works, but then I have to change it for release.

Is the only valid way for this using #ifdef ?

  • 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-02T19:56:24+00:00Added an answer on June 2, 2026 at 7:56 pm

    You need to specify library path in project settings (“additional library directories” in linker settings – at least in vc2008), for both debug and release configuration. You can use macros like ${ConfigurationName} and ${SolutionDir}, so specifying paths within project should be easy enough.

    Also it might be a better idea to include libraries using linker settings instead of #pragma comment.

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

Sidebar

Related Questions

Unusual problem here: I have an app that uses a text file which contains
I'm using Visual Studio 2008 and I have a solution which contains multiple projects.
I have a number of projects in a solution file that have unit tests
I have a solution with several projects. One of them is a setup project.
I have a solution with many projects. One project contain few custom components. One
I have a solution consisting of five projects, each of which compile to separate
I have a CSS file which contains several hundred 16x16 icons. They are referenced
I have a problem here which i am trying to solve. The program is
I have a vanilla Visual Studio 2005 Solution with a single C++ Project which
I have referenced a config file that is located in a solution folder. I

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.