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

Compiling Issues with multiple files

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



Joined: 15 Mar 2008
Posts: 53

View user's profile Send private message

Compiling Issues with multiple files
PostPosted: Mon May 05, 2008 7:15 pm     Reply with quote

Hi,
I am playing around a very simple code, but I got a compiler error,
Quote:

Error 128 "C:\Test\test.h" Line 1(0,8): A #DEVICE required before this line


My code is composed with 3 files, main.c, test.c and test.h. They are all very simple.
main.c:
Code:

#include <16F886.h>
#include <stdio.h>
#include <stdlib.h>
#include <test.h>

#use delay(clock=8000000)
#fuses INTRC, NOWDT, PUT, MCLR, NOPROTECT, NOCPD, NOBROWNOUT, NOIESO, NOFCMEN, NOLVP, NOWRT

void main()
{

   while(1)
  {

   lower_C0();
 
  }
}

test.c:
Code:

#include <test.h>

void lower_C0()
{
 output_low(PIN_C0);
}

test.h
Code:

void lower_C0();

Could anyone tell me what I miss in my code? My compiler is PCM 4.071.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 05, 2008 7:27 pm     Reply with quote

FAQ article on using CCS with MPLAB:
http://www.ccsinfo.com/faq.php?page=ccs_mplab6

Answer to a recent question to use multiple source files with MPLAB:
http://www.ccsinfo.com/forum/viewtopic.php?t=34046

More detailed information on using multiple files with MPLAB.
Read all the links in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=32221

How to debug CCS code in MPLAB with the ICD2:
http://www.ccsinfo.com/forum/viewtopic.php?t=33505
boulder



Joined: 15 Mar 2008
Posts: 53

View user's profile Send private message

PostPosted: Mon May 05, 2008 9:45 pm     Reply with quote

Thanks, it works.
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