Link to home
Start Free TrialLog in
Avatar of hed
hed

asked on

VC++ ( project builds with no reason )

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 ?

Avatar of Answers2000
Answers2000

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.
ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial