954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

static lib file in visual studio 2007

Can someone tell me how to add a static library file to a project in visual studio 2007.

guy40az
Junior Poster in Training
57 posts since Mar 2007
Reputation Points: 10
Solved Threads: 2
 

Something like this perhaps ?

#pragma comment(lib, "mylib.lib")
William Hemsworth
Posting Virtuoso
1,591 posts since Mar 2008
Reputation Points: 1,429
Solved Threads: 129
 

In VC 6 you add it in.

Project --> Settings --> Link Tab --> change Catetory to input then add the library to the Object/library modules list. In the left pain, change Settings For to All Configurations.

I was just wondering if it was similar in 2007

guy40az
Junior Poster in Training
57 posts since Mar 2007
Reputation Points: 10
Solved Threads: 2
 

If you'd like to link to a lib through the compiler's interface rather than using #pragma, right-click on your project's name in the panel to the left, go down to properties, expand linker, go to input, and put the libraries names in the additional dependencies field, separated by spaces.

CoolGamer48
Posting Pro in Training
401 posts since Jan 2008
Reputation Points: 77
Solved Threads: 40
 

Thanks CoolGamer48 you are a genius

guy40az
Junior Poster in Training
57 posts since Mar 2007
Reputation Points: 10
Solved Threads: 2
 
Thanks CoolGamer48 you are a genius


No problem. It's not that hard after you do it once...

CoolGamer48
Posting Pro in Training
401 posts since Jan 2008
Reputation Points: 77
Solved Threads: 40
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You