Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Learning Visual C++ 2012


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Juskelis   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 August 2013 - 03:33 PM

So I'm a computer science major learning in C++, but my school doesn't teach us using Visual Studio. I know how to do a lot of the basics of programming, so instead I'm looking more for how to do advanced stuff with Visual Studio.

 

Namely how to deal with adding my own libraries to a project and getting them to work, or more generally anything involving the Project Properties window. Do you guys know anywhere that can teach me how to do that?



Sponsor:

#2 Scarabus2   Members   -  Reputation: 556

Like
1Likes
Like

Posted 26 August 2013 - 03:09 AM

To include a static library to an existing project you need to do the following:
* Add the include path(s) to the library's headers.
* Add the library path to the library itself.

These are done in the project configuration tab.
* Add the library ("foo.lib") to the "Linker - Additional libraries" box

This should in theory be it, but you may run into linker errors if:
* The library in question requires other libraries to be included.
* The library was built in a different configuration than your project (I think this is Windows-only. /MDd or /MD flags needs to be same for both)

There are probably other considerations to be made, that other posters can supply.


visualnovelty.com - Novelty - Visual novel maker

#3 NightCreature83   Crossbones+   -  Reputation: 3030

Like
0Likes
Like

Posted 26 August 2013 - 03:31 AM

You can add the include headers and library path to the VC++ Directories tab in the solution configuration, that way you dont have to provide fulll path to any of the inluded headers or library files.


Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, Mad Max

#4 warnexus   Prime Members   -  Reputation: 1504

Like
0Likes
Like

Posted 27 August 2013 - 04:19 PM

Youtube videos are awesome to learn too if you are looking for quick conceptual understanding.

 

 

 

 



#5 Juskelis   Members   -  Reputation: 126

Like
0Likes
Like

Posted 28 August 2013 - 08:09 PM

To include a static library to an existing project you need to do the following:
* Add the include path(s) to the library's headers.
* Add the library path to the library itself.

These are done in the project configuration tab.
* Add the library ("foo.lib") to the "Linker - Additional libraries" box

This should in theory be it, but you may run into linker errors if:
* The library in question requires other libraries to be included.
* The library was built in a different configuration than your project (I think this is Windows-only. /MDd or /MD flags needs to be same for both)

There are probably other considerations to be made, that other posters can supply.

 

So if I were to add foo.lib to my project using that, would I need to move the library to somewhere special? Or could I just do the full path to foo.lib?

 

 

You can add the include headers and library path to the VC++ Directories tab in the solution configuration, that way you dont have to provide fulll path to any of the inluded headers or library files.

 

I like that idea. Do I just edit the library directories field in there? Just out of curiousity, what's the Library WinRT Directories?



#6 ZachHoefler   Members   -  Reputation: 122

Like
1Likes
Like

Posted 30 August 2013 - 02:54 AM

It's only a rather small portion of the book, but the part of Game Coding Complete goes through a bit of project setup before diving into coding (see the start of Ch4). It sets up external libraries, changes output directories for a cleaner solution directory, etc.

 

 

To include a static library to an existing project you need to do the following:
* Add the include path(s) to the library's headers.
* Add the library path to the library itself.

These are done in the project configuration tab.
* Add the library ("foo.lib") to the "Linker - Additional libraries" box

This should in theory be it, but you may run into linker errors if:
* The library in question requires other libraries to be included.
* The library was built in a different configuration than your project (I think this is Windows-only. /MDd or /MD flags needs to be same for both)

There are probably other considerations to be made, that other posters can supply.

 

So if I were to add foo.lib to my project using that, would I need to move the library to somewhere special? Or could I just do the full path to foo.lib?

It just has to be in one of the library directories you specified in the previous step. Not sure how VS handles two files with the same name in different directories, though.

 

If you want an example of someone including libraries/directories/etc, you could look up an example of including DirectX in a version of VS pre-2012. A quick Google search gives this example.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS