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 support@ccsinfo.com

Included header files

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







Included header files
PostPosted: Mon Jun 21, 2004 5:40 am     Reply with quote

As a newbe to the CCS compiler, I have a problem with including a main.h with a main.c.

For some reason the compiler does not recognise or accept the contents of the header file resulting in spurious error messages such as undefined type and no such function.

It seems if I include the contents of the header file main.h in main.c and delete main.h or the contents of main.h then there is no problem. I no not normally have this problem with other compilers such as borland, MSVC++ and GNU.

reply much appricated.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 21, 2004 2:24 pm     Reply with quote

I made a test program, and it worked OK. I compiled this
with PCM vs. 3.202 and used MPLAB vs. 6.42.
I made a new project named "Main", and added the main.c
source file to the "Source Files" section in the Project window.
MPLAB picked up Main.h during the compile, and added it
to the "Header Files" section by itself. I got one warning
about "Condition always True" during the compile. That's OK.
I suggest that you try this test program, and see if it works.

The following code is in main.c
Code:
#include <16F877.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)

#include "main.h"
//============================================
void main()
{

func1(MY_CONSTANT);

while(1);
}
//========================
// FUNCTIONS

char func1(char c)
{
c += 5;

return(c);
}
 


-----------------------------------------------------
The following code is in main.h
Code:
#define MY_CONSTANT  0x55

char func1(char c);
Guest
Guest







Is it case related?
PostPosted: Mon Jun 21, 2004 6:55 pm     Reply with quote

Long time ago I has similar problem using various *.h files and it was related to case sensitivity.
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