Solved

VC++ ( project builds with no reason )

Posted on 1998-08-24
2
180 Views
Last Modified: 2010-04-01
When i build a certain project. it compiles some of the files though i don't do anything between the builds.
( I"ve built the project than immedietly built it again and again. and each time it compiled some of the files).
Is it a bug ? Is there a workaround but to create the project from beginning and move the code ?
how can i know for a specific file which are it's dependancies ?

0
Comment
Question by:hed
  • 2
2 Comments
 
LVL 8

Expert Comment

by:Answers2000
ID: 1171044
I've had this problem.  There may be more than one reason for the problem.  


QUESTION

1. Did you ever
(i) Set your clock forward (even if you set it back later)
(ii) Get the files from another PC
(iii) Transfer files across a network or via e-mail or via server directory

If the answer to any of the above is yes - then this is probably what has happened :-

1. The source (or header) date of the file is AHEAD of the current PC clock.  Therefore the compiler's build/make assumes you have always changed the file.
2. Even if you edit a file once in VC, it doesn't always seem to always set the date back.

The soln in my case was to
1. Exit VC
2. Check file dates in DOS, for every .h/.cpp/.inl/.c/.rc file that had a future date, open it in EDIT and save back without changes (to reset the file date to current tme)
3. Delete all intermediate files - objs, exes, pchs, etc.
4. Restart VC and rebuild all.  After this it was okay.


There doesn't seem to be a compile bug, it relates to how the compiler/make works (it compares the date of output files with input files, so if input files have future dates, the output files will always appear out of date).

There does seem to be an annoying an intermittent bug/feature with setting the file date stamp back in VC.
0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 20 total points
ID: 1171045
I've had this problem.  There may be more than one reason for the problem.  


QUESTION

1. Did you ever
(i) Set your clock forward (even if you set it back later)
(ii) Get the files from another PC
(iii) Transfer files across a network or via e-mail or via server directory

If the answer to any of the above is yes - then this is probably what has happened :-

1. The source (or header) date of the file is AHEAD of the current PC clock.  Therefore the compiler's build/make assumes you have always changed the file.
2. Even if you edit a file once in VC, it doesn't always seem to always set the date back.

The soln in my case was to
1. Exit VC
2. Check file dates in DOS, for every .h/.cpp/.inl/.c/.rc file that had a future date, open it in EDIT and save back without changes (to reset the file date to current tme)
3. Delete all intermediate files - objs, exes, pchs, etc.
4. Restart VC and rebuild all.  After this it was okay.


There doesn't seem to be a compile bug, it relates to how the compiler/make works (it compares the date of output files with input files, so if input files have future dates, the output files will always appear out of date).

There does seem to be an annoying an intermittent bug/feature with setting the file date stamp back in VC.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now