Solved

VC++ ( project builds with no reason )

Posted on 1998-08-24
2
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

738 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