- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to include libraries in Visual Studio 2012?
To add libraries in Visual Studio 2012, there are two different methods. The first one is manual method. The second one is adding libraries from code.
Let us see the manual method first.
To add some library, we have to follow these five steps −
- Add the #include statements necessary files with proper declarations. For example −
#include “library.h”
- Add the include directory for the compiler look up;
- Go to the Configuration Properties/VC++ Directories/Include Directories
- Then click and edit, and add new entry
- Add one library directory for *.lib files:
- Go to project (on top bar) -> properties -> Configuration Properties -> VC++ Directories -> Library Directories, then click and edit, and add new entry.
- Link the lib’s *.lib files −
- Go to Configuration properties -> linker -> input -> Additional Dependencies
- Place *.dll files either −
- In the directory you will be opening final executable from or into Windows/System32
Now we will see how to add libraries using code −
Use the compiler directives #pragma −
#pragma comment(lib, “library.lib”)
Advertisements