HI-TIDE >> HI-TIDE

Pages: 1
lupo
stranger


Reged: Aug 02 2009
Posts: 24
#include and files in HITIDE
      #148122 - Sun Feb 07 2010 04:46 AM

Hi all,
I used mplab and picc18 for a long time and everything worked perfect.
Now I tried hitiede but I face a problem qhen using eht directive #include.

Let s say in my workspace in my project directory I created a new file
Code:
 

main.c



and later I created a function in another file (in the same folde projects) ..let s say
Code:
  
func.c



Putting the diective

Code:
 

#include "func.c"



I get an error when recalling the function (for istance init(): defined in the second file)
it says that the function has been redefined.

In MPLAB I never faced this problem.
How can I include my function defined in different files in my project directory?
Both file area created with hitide!!

Thanks

Cheers

Edited by lupo (Sun Feb 07 2010 04:54 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan HenryModerator
Guru
****

Reged: Oct 16 2003
Posts: 3863
Loc: Colorado
Re: #include and files in HITIDE [Re: lupo]
      #148152 - Sun Feb 07 2010 10:36 AM

#include'ing C source files is not conventional practice.

See http://c-faq.com/decl/decldef.html and links therein.


Post Extras: Print Post   Remind Me!   Notify Moderator  
lupo
stranger


Reged: Aug 02 2009
Posts: 24
Re: #include and files in HITIDE [Re: Dan Henry]
      #148372 - Mon Feb 08 2010 10:47 AM

Thank you for your help
I m going to bookmark that link in my browser!

Again thanks

Cheers!


Post Extras: Print Post   Remind Me!   Notify Moderator  
lupo
stranger


Reged: Aug 02 2009
Posts: 24
Re: #include and files in HITIDE [Re: Dan Henry]
      #148992 - Thu Feb 11 2010 02:49 PM

Hi Henry,
how do you define a strcture?
in a separate file.h?
(in case the structure is really big an dcannot be accomodated into the main file oder in other any file and considered that must be declared in the global scope)

do you declare the structure in a file..let's say struct.h, and then #include "struct.h" in your functionfile?

I couldn't find any answer in the link you posted to me.

Thanks in advance

Cheers!!


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 11 anonymous users are browsing this forum.

Moderator:  jtemples, mikerj, Dan Henry, Andrew L 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 223

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5