Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add additional libraries to Visual Studio project?

Allergro is an open souce C++ addon library for graphics manipulation. How do I add this library to my compiler?

The instructions don't work for me as I have Windows 7. I don't know if the OS matters. I have the Visual Studio Express Edition. The library is a .dll file. How do I add it to my projects?

like image 446
Saad Masood Avatar asked Dec 14 '10 23:12

Saad Masood


People also ask

How do I add a library to Visual Studio?

Right-click on the solution in Solution Explorer and select Add > New Project. On the Add a new project page, enter library in the search box. Choose C# or Visual Basic from the Language list, and then choose All platforms from the Platform list. Choose the Class Library template, and then choose Next.

How do you add a library to a project?

Right-click the Java project to which you want to add a library, and select Properties from the menu. Select Java Build Path, and click the Libraries tab. Click the Add Library button, and choose the appropriate Java EE Library. Click Next to view the library contents, and click Finish.

How do I add a third party library in Visual Studio?

Add third-party libraries to a project Over 900 C++ open source libraries are available via the vcpkg package manager. Run the Visual Studio integration step to set up the paths to that library when you reference it from any Visual Studio project. There are also commercial third-party libraries that you can install.


2 Answers

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.

like image 172
2 revs, 2 users 97% Avatar answered Oct 09 '22 17:10

2 revs, 2 users 97%


Add #pragma comment(lib, "Your library name here") to your source.

like image 40
Billy ONeal Avatar answered Oct 09 '22 17:10

Billy ONeal