How to setup a library

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hellow all,

I am starting to learn C programing and I want to use a library for the Nokia LCD 3310/5110. I got the attached files . How to setup them to make a liabrary.

I am using the AVR studio to do the C programing.

Thanks in advance.
Manuel Silva

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have another file (Make File). I can not add the Make file.

thanks
Manuel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How to setup them to make a liabrary

Are you talking about a "real" library - that is something like a libnokia.a where you just provide the user that binary and a nokia.h or similar?

If so then a lib cannot contain a symbol called main()/main: and you build a lib as per the manual:

http://www.nongnu.org/avr-libc/u...

If you are talking about a source "library" then you just did it didn't you? Your lib.c and lib.h are such a "library".

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clawson, thens for your answer.

I just got the files from the net. Were do I must put them? In the same directory of the program I want use them?

thanks.
Manuel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh I see the thread title is a misnomer. You don't mean "setup" in the sense of "set one up for others to use". You mean how do I use one that someone else has already setup for me to use.

Surely it's just a case of #include'ing the .h in your own files where the lcd_*() functions are called and then adding the .c to the list of files to be compiled and linked in your Makefile.

(the reason you couldn't post it before is you are only allowed 3 attachments per post - nothing stops you adding it in another post).

If the current Makefile has a line that says:

SRC = main.c

or perhaps

SRC = $(TARGET).c

then on the end of the line just add one space and then lcd.c

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Claawson, In the make file I have

# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c lcd.c

According to what you say I do not need to do any thing.
I am using the AVrStudio to write the program (I am going to start it yet) to use these program I #include the lcd.h in my own program. The .c were do I have to put them?

Sorry to bother you with this stupid questions, but, I just used a few times the AVRStudio to make C code.

Thanks,
Manuel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The make file is here.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now I'm confused. If you are using Studio why are you worrying about Makefile's ? Surely you just add main.c and lcd.c to the project list of source files and let Studio create a Makefile to build them both? Or are you saying your Studio project has the "Use external Makefile" option ticked? If so, why?

Oh and I don't think you've actually said what build errors you are trying to correct anyway?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clawson, Thanks again.

I do not have the option to "Use external Makefile".

This may seem ridiculous, but, I am not sure if I know how to add the main.c and lcd.c to the project list of source files.

Can you please give me more details.

Again, I apologise to make so ridiculous questions.

Thanks.
Manuel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you can open AVRstudio, create a new project, and you see 'source files' in the left hand panel, you can right-click on source files and add you files to the project. This is about 99% of what I know about using AVRstudio. I hope it helps you.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Holy crap I must be dreaming. I think I just saw Bob answer a question about using the GCC compiler ?!?!?

Nope, must be a dream...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had started to write something like:

Bob, We are Borg. Resistance is futile. You will be assimilated.

Then I had to make dinner and forgot to post it. Damn :?

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bobgardner, thanks for your help.

Regards,
Manuel