Sign in to follow this  
digitalfreak

VC++ compiler doesn't recompile headers when buiding project?

Recommended Posts

I had a function declaration in a .h file, and it has default arguments in the declaration. the function's definition is in the corresponding .cpp file. when I change the default arguments to other default values in the header file and build the project, I found it still uses the old default value. pls explain. thanx.

Share this post


Link to post
Share on other sites
When you compile your project, the compiler tries to determine what files it actually needs to recompile and compiles them. What is probably happening is that the CPP files where you actually use the default variables haven't changed when you recompile, and so the compiler thinks that it can skip them. When this happens, simply use the "Rebuild All" option of Visual Studio.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this