Jump to content
  • Advertisement
Sign in to follow this  
Neon2302

Need help on really noob question about VC2005

This topic is 4005 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys I'm very new in VC IDE, I'm using VC2005 as my IDE for C++ project. the problem is, I'm already created reusable files (as my game engine). But when I pretend to reuse them I need to copy and paste to the new folder (new project/ or new solution). I can't set the other project/solution to point to the same files (h and cpp). Even I try to add include file to the same folder, Link error occur. anyone can give me suggestion on this problem, since now I try to set up third project that use the same files. so I need to copy and paste more often and some time I forget which one is the last updated. Thank you Chet Chetchaiyan

Share this post


Link to post
Share on other sites
Advertisement
Right-click you project name at the Solution Explorer and go to Properties(or menu Project>Properties). Then in the C/C++>General section, look for 'Additional Include Directories' and insert the directories where your headers are located. And in the Link>General section, look for 'Additional Library Directories' and insert the directories where your .libs reside.

HTH

Share this post


Link to post
Share on other sites
The problem is my own code didn't .lib it's just a part of code in the project that out put as .exe, I don't know how to make the output to be .lib files

Share this post


Link to post
Share on other sites
Oh thank you. It's work. I don't know that making .lib files didn't require to change any coding.

as I always look in open source lib file all of them use 'extern' or somethings so I think export .lib requires extra code

Thank you any ways ^_^

Share this post


Link to post
Share on other sites
If your source files aren't in a static library (.lib) then you need to add the source files to the project as well. Just right click on your project and then add existing files.

The prefered method is the keep all of your reusable code in a static library. To do this add a new project to the solution (C++ -> Win32 Application -> Static Library), and set up your includes / source files and add them all into the new project.

When you want to use your library the easiest way is to right click your project and then click on dependencies. Check the box next to your project and the linker will link the correct lib file. Just remember to set up your directories for header files in your project.

Hope that helps!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!