2

Author Topic: makefile question  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

Offline apc3161Topic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
makefile question
« on: June 28, 2009, 03:06:34 PM »
Hello all,

I tried to rewrite most of $50 robot code from scratch to make sure I understood everything. However, after adding
Code: [Select]
#include a2d.h
to my code, I got the error message

undefined reference to `a2dConvert8bit'

This is an error message that did not appear when I used the tutorial's code. My guess is that it has something to do with the makefile (I am just using AVR studio's default one, as opposed to the external one given in the tutorial)

Anyways, I noticed I could get there error message to go away if I added

Code: [Select]
#include a2d.c
to my code and added that file to my project directory. However, while the program compiles, I do not think the a2dconvert8bit function is actually working correctly. My guess is again that it has something to do with the makefile, because that is the only thing I haven't touched so far.

Can someone please explain in simplified English what a makefile is and how it works. Does anyone know of a way to fix my problem while still using AVR studio's default makefile? I would prefer that, because I opened up the tutorial's makefile to see what was inside and it looked mostly like gibberish, and I would prefer to not have to learn what all that stuff means, and instead just use the default makefile for all my projects.

Any help is appreciated. Thanks

Offline Trumpkin

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Re: makefile question
« Reply #1 on: June 28, 2009, 03:58:16 PM »
You are not including a2d.h and a2d.c correctly, try this:
Code: [Select]
#include "a2d.h"
« Last Edit: June 28, 2009, 06:31:56 PM by Trumpkin »
Robots are awesome!

Offline apc3161Topic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: makefile question
« Reply #2 on: June 28, 2009, 06:00:42 PM »
Sorry, it wasn't a copy/paste. It is written correctly in the actual program.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: makefile question
« Reply #3 on: June 29, 2009, 04:37:24 PM »
In the makefile there should be the line with something like (TARGET).c or something, just add the a2d file to the end of that.

Offline apc3161Topic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: makefile question
« Reply #4 on: June 30, 2009, 04:07:19 PM »
In the makefile there should be the line with something like (TARGET).c or something, just add the a2d file to the end of that.

I ended up just using the $50 robot makefile, and changing target name from photovore_v1 to my project name. However, this thing still didnt work. I even replaced my code with the photovore_v1 verbatim, copy and paste. Yet still didn't work. So I'm unbelievably confused. Does anyone have a good link to a tutorial on how makefiles work?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,154
  • Helpful? 110
Re: makefile question
« Reply #5 on: June 30, 2009, 04:42:00 PM »
Perhaps you could post your makefile
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here

data_list