CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

include <math.h> twice

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
NivNavick



Joined: 01 Nov 2010
Posts: 47

View user's profile Send private message

include <math.h> twice
PostPosted: Sat Mar 05, 2011 3:21 am     Reply with quote

Hi ,
I included math.h file in two of my .c files and it gives me an error
Quote:
Function definition different from previous definition y != float


when I delete one of the two includes it's works perfectly but when there is more than one
Code:
include<math.h>
in my program it's writing the above error

what should I do in order to fix it?

Thanks

(CCS COMPILER V 4.114 )
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 05, 2011 3:12 pm     Reply with quote

Delete all of them except one:
Include math.h in your main source file, and put it above any other
#include statements for other source files.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sat Mar 05, 2011 4:05 pm     Reply with quote

If you look at the file, it shouldn't matter if you load it twice. The file tests right at the start for 'math_h' being defined, and if it is, the rest of the file doesn't load. If not, it defines this, and loads.
A number of possibilities exist:
1) The file has been modified.
2) A second file with the same name is present.
3) A very old version.
4) Something else is modifying the math_h define.
etc...

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group