Add Library to Visual Studio 2008 C++ Project

Add Library to Visual Studio 2008 C++ Project

It's under Project Properties / Configuration Properties / Linker / Input / Additional Dependencies.

The help tip at the bottom of the screen says "Specifies additional items add to the line line (ex: kernel32.lib)".

How to link a .lib in Visual Studio 2008 C++

To link with a .lib file, you just need to:

  • right clic on the project name, select Properties
  • under Properties->configuration properties->C/C++->General item "other include directories" add the path to your .h file
  • under Properties->Linker->Input add the path and name of your .lib file

And that's it.

Microsoft Visual Studio C++ 2008 where to include directories and library files

Open up the properties for your project. To set the include folders expand the C/C++ tree node and select General. On that page you should see a setting Additional Include Directories set as needed. As far as the lib files, select the Linker node and expand it. On the General section there is an Additional Library Directories where you can specify paths, and then on the Input node you can set the lib file names to include.

One important note, you need to set it for each configuration you plan to build or set it for all configurations, this gives the flexibility to be able to set different include paths for debug/release builds. You can change between configurations at the top of the pop-up window where it says Configuration

How to add additional libraries to Visual Studio project?

For Visual Studio you'll want to right click on your project in the solution explorer and then click on Properties.

Next open Configuration Properties and then Linker.

Now you want to add the folder you have the Allegro libraries in to Additional Library Directories,

Linker -> Input you'll add the actual library files under Additional Dependencies.

For the Header Files you'll also want to include their directories under C/C++ -> Additional Include Directories.

If there is a dll have a copy of it in your main project folder, and done.

I would recommend putting the Allegro files in the your project folder and then using local references in for the library and header directories.

Doing this will allow you to run the application on other computers without having to install Allergo on the other computer.

This was written for Visual Studio 2008. For 2010 it should be roughly the same.

How do I create a C++ library in VS 2008?

If the projects are in separate folders, you may have you do something like:

#include "../libproject/Library.h"

How to upgrade the project build in visual studio 2005 to visual studio 2008?

Opening in VS 2008 is the only way to upgrade.

But it looks like you need to clean up some of the references... this will be a manual step (likely just need to set a few paths). Start by fixing the first error, it is likely many of the subsequent errors are a consequence of that first error.

Normal practice is to have a copy of referenced libraries (including typelibs) somewhere in your source tree, so you are not dependent on absolute paths into the OS or other application's install folders. (Or the continuing existence of that library).

How to use static pthread library in C program (Visual Studio 2008)?

You have to add the following line to your application when you're linking statically.

#define PTW32_STATIC_LIB


Related Topics



Leave a reply



Submit