C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 5th, 2003, 02:27 PM
BDKR's Avatar
BDKR BDKR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Tampa, Florida
Posts: 31 BDKR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 29 sec
Reputation Power: 12
Send a message via AIM to BDKR Send a message via Yahoo to BDKR
A question about gcc...

Well, since there are some things that aren't a good idea in PHP, I've been working on my C skills. And having a lot of good luck too. I can't complain.

Something seems strange with gcc. Does it keep a cache of files of some sort? Here is what's going on. I am updating a dock app (wmbluecpu) to give the user options in text and load color. Pretty simple for the most part as it involves creating some addtional xpm files and capturing the additional arguments at the command line.

However, when making some changes to these xpm files (I deleted a couple that I bunged up!), I started seeing compiler errors. Now I'm sorry that I didn't capture the output. I didn't think about, but the problem has been dealt with for the most part.

Anyway, those errors were relating to failed includes of those deleted xpm files! That seems to suggest to me that the compiler is caching on some level. Anybody ever see
any behaviour like this.

Cheer,
BDKR

Reply With Quote
  #2  
Old June 5th, 2003, 03:03 PM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 6,255 dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 5 Days 20 h 26 m 55 sec
Reputation Power: 1985
Are you just using gcc by itself from the command line, or with a makefile, or from within an integrated development environment (IDE)? If the latter two cases, then you might be blaming gcc for what they're doing.

If you're using a makefile, then the dependencies might not set up accurately. Normally in doing a make, the timestamp of the object files are checked against those of the corresponding source files and the object is only recompiled if any source that it depends on is more recent. The dependency list of the makefile is how make knows which source files each object depends on. If that dependency list is inaccurate, then an object file might not get updated when it needs to be, which can cause the program to behave incorrectly even to the point of crashing.

gcc can generate a dependency list for you. Assuming that all the .c files in a directory are part of your project:

gcc -MM *.c

Then you can capture that list and insert it into your makefile.

Reply With Quote
  #3  
Old June 5th, 2003, 03:55 PM
BDKR's Avatar
BDKR BDKR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Tampa, Florida
Posts: 31 BDKR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 29 sec
Reputation Power: 12
Send a message via AIM to BDKR Send a message via Yahoo to BDKR
Quote:
Originally posted by dwise1_aol
Are you just using gcc by itself from the command line, or with a makefile, or from within an integrated development environment (IDE)? If the latter two cases, then you might be blaming gcc for what they're doing.


It's from a makefile.

Quote:

If you're using a makefile, then the dependencies might not set up accurately. Normally in doing a make, the timestamp of the object files are checked against those of the corresponding source files and the object is only recompiled if any source that it depends on is more recent. The dependency list of the makefile is how make knows which source files each object depends on. If that dependency list is inaccurate, then an object file might not get updated when it needs to be, which can cause the program to behave incorrectly even to the point of crashing.



I wonder if screwing around with different copies of the same file is what did it. It seems to be working fine now.

Quote:

gcc can generate a dependency list for you. Assuming that all the .c files in a directory are part of your project:

gcc -MM *.c

Then you can capture that list and insert it into your makefile.


That's good 411! I had better go back and check the man page eh?

Thanx!,
BDKR

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > A question about gcc...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap