Solved

VC++ ( project builds with no reason )

Posted on 1998-08-24
2
184 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 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

16 Experts available now in Live!

Get 1:1 Help Now