Question about linking in a static library with Visual Studios 2008

Started by
1 comment, last by chadsxe 16 years, 3 months ago
So I am using VC++ 2008. I have two projects under one solution. One project compiles to a static library and the other uses that static library to build an .exe. I used the steps outlined here http://msdn2.microsoft.com/en-us/library/ms235627(VS.80).aspx to perform this. When I build my project in debug it works perfect. But when I build it via "Release" it claims that it can't find a .h that is in the Static Lib project. I did exactly what the link tells me to do but like I said I only am able to build via "Debug" and not "Release". Not sure what I am missing and was hoping someone would have some insight. Regards Chad
Advertisement
Check that your "Release" project configuration has the same settings that makes other project to be accessable; VisualStudio changes settings when you switch modes "Debug", "Release", etc.

For example this point could not be set in your project "Release" mode, but only in "Debug" mode:

"To reference the header files of the static library, you must modify the include directories path. To do this, from the Property Pages dialog, expand the Configuration Properties node, then the C/C++ node, and select General. Next to Additional Include Directories, type in the path to the location of the MathFuncsLib.h header file."

* Another option you can do is to set VC++ Include & Lib directories for whole VisualStudio IDE under Tools->Options->Projects & Solutions->VC++ Directories
@EvaldsUrtans

You nailed it on the head. I never realized there were two diffrent configurations you could do. I had to follow those steps in release mode. Muhc appreciated.

Regards

Chad

This topic is closed to new replies.

Advertisement