Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Ashkar_Malik
PostPosted: Jun 07, 2011 - 08:30 PM
Wannabe


Joined: Mar 21, 2011
Posts: 66


I got this silly question since I am new to AVR Studio please clarify my doubts,How do I include header files into AVR Studio 5?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 07, 2011 - 08:42 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62245
Location: (using avr-gcc in) Finchingfield, Essex, England

Code:
#include
perhaps?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Ashkar_Malik
PostPosted: Jun 07, 2011 - 09:20 PM
Wannabe


Joined: Mar 21, 2011
Posts: 66


no I means that If I a have written a program in c and and another user built header is to be included into the project file ,then what procedure is to be followed!!!

_________________
AkA GodFather
 
 View user's profile Send private message  
Reply with quote Back to top
EW
PostPosted: Jun 07, 2011 - 09:36 PM
Raving lunatic


Joined: Mar 01, 2001
Posts: 4953
Location: Rocky Mountains

#include "other_header_file.h"

And then make sure the compiler knows where to find "other_header_file.h".

_________________
Eric Weddington
Marketing Manager
Open Source & Community
Atmel
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
indianajones11
PostPosted: Jun 07, 2011 - 09:46 PM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3552
Location: San Diego, Ca

EW wrote:
#include "other_header_file.h"

And then make sure the compiler knows where to find "other_header_file.h".
One way of doing that is to put a COPY of it into the pjt. folder. See my tutorial for another. Mr. Green The method should apply to the AS5 IDE too.

_________________
1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1
 
 View user's profile Send private message  
Reply with quote Back to top
Ashkar_Malik
PostPosted: Jun 08, 2011 - 07:01 AM
Wannabe


Joined: Mar 21, 2011
Posts: 66


Thank you,Its working! Smile

_________________
AkA GodFather
 
 View user's profile Send private message  
Reply with quote Back to top
Ashkar_Malik
PostPosted: Jun 08, 2011 - 07:09 AM
Wannabe


Joined: Mar 21, 2011
Posts: 66


I got another question That I bought an robokits avr development board based on avr atmega32,They supplied some example codes with it but I was wondering that the lcd.h header file is equipped with an lcd.c file and a main file so what is the lcd.c file. when I execute the pogram the compiler shows error "undefined reference lcd_init , lcd_puts"

_________________
AkA GodFather
 
 View user's profile Send private message  
Reply with quote Back to top
atomicdog
PostPosted: Jun 08, 2011 - 07:17 AM
Posting Freak


Joined: Jan 14, 2008
Posts: 1147
Location: San Diego

Ashkar_Malik wrote:
I got another question That I bought an robokits avr development board based on avr atmega32,They supplied some example codes with it but I was wondering that the lcd.h header file is equipped with an lcd.c file and a main file so what is the lcd.c file. when I execute the pogram the compiler shows error "undefined reference lcd_init , lcd_puts"
You need to compile (and link) lcd.c along with the main file.

_________________
~~John
TWI C source code
 
 View user's profile Send private message  
Reply with quote Back to top
Ashkar_Malik
PostPosted: Jun 08, 2011 - 07:55 AM
Wannabe


Joined: Mar 21, 2011
Posts: 66


ok thanks ,I understand that,Now the code is working.

_________________
AkA GodFather
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 08, 2011 - 09:24 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62245
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

One way of doing that is to put a COPY of it into the pjt. folder

I'd only do this by a soft-link, otherwise you'll end up with multiple copies which can become a source control nightmare. Far better is to learn about passing -I to the GCC compiler.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits