Code::Blocks Forums

User forums => Help => Topic started by: Keyla on June 12, 2007, 08:40:26 pm

Title: WinAVR Project Migration
Post by: Keyla on June 12, 2007, 08:40:26 pm
Hi there!

I tried to test out the new support of AVR-GCC and AVRLibC (both = WinAVR package). For this I migrated some projects that I build using make and an editor to  a new empty project. Then I setted the compiler to AVR-GCC and checked the right CPU type.
Next created an #f_cpu declaration for the cpu frequency. No problem if you had some experiences.

But my problem is to get the whole project compiled. I've get allways "allready declared here..." or "undeclared symbol". That might be a problem with the dependencies (I used not every time headers).
I don't know if CB analyses the dependencies differently than pure make/mfile?

If you like I can post my project but I doesn't wonna let you think that I wan't just to shift my responsibility ;)
Title: Re: WinAVR Project Migration
Post by: mandrav on June 12, 2007, 09:48:31 pm
If you like I can post my project but I doesn't wonna let you think that I wan't just to shift my responsibility ;)

No need for that (not for now at least). Just enable full logging and post the build log here.
Title: Re: WinAVR Project Migration
Post by: Keyla on June 13, 2007, 09:08:54 pm
o.k. here is the full command line log:
Code
-------------- Build: Debug in GLCD ---------------
avr-gcc.exe -mmcu=atmega64  -IC:\Programme\Entwicklung\WinAVR\include -IC:\Programme\Entwicklung\WinAVR\avr\include  -c Source\S1D13700.c -o obj\Debug\Source\S1D13700.o
In file included from Source\S1D13700.c:2:
C:\Programme\Entwicklung\WinAVR\avr\include/util/delay.h:136:3: warning: #warning "F_CPU not defined for <util/delay.h>"
Source\S1D13700.c: In function `glcdInitHW':
Source\S1D13700.c:271: error: `GLCD_DATA_DDR' undeclared (first use in this function)
Source\S1D13700.c:271: error: (Each undeclared identifier is reported only once
Source\S1D13700.c:271: error: for each function it appears in.)
Source\S1D13700.c:272: error: `GLCD_CTRL_DDR' undeclared (first use in this function)
Source\S1D13700.c:272: error: `GLCD_CTRL_A0' undeclared (first use in this function)
Source\S1D13700.c:272: error: `GLCD_CTRL_RW' undeclared (first use in this function)
Source\S1D13700.c:272: error: `GLCD_CTRL_RD' undeclared (first use in this function)
Source\S1D13700.c:272: error: `GLCD_CTRL_RESET' undeclared (first use in this function)
Source\S1D13700.c:274: error: `GLCD_DATA_PORT' undeclared (first use in this function)
Source\S1D13700.c:277: error: `GLCD_CTRL_PORT' undeclared (first use in this function)
Source\S1D13700.c: In function `glcdControlWrite':
Source\S1D13700.c:298: error: `GLCD_DATA_PORT' undeclared (first use in this function)
Source\S1D13700.c:299: error: `GLCD_CTRL_PORT' undeclared (first use in this function)
Source\S1D13700.c:299: error: `GLCD_CTRL_A0' undeclared (first use in this function)
Source\S1D13700.c:300: error: `GLCD_CTRL_RW' undeclared (first use in this function)
Source\S1D13700.c: In function `glcdControlParamWrite':
Source\S1D13700.c:308: error: `GLCD_DATA_PORT' undeclared (first use in this function)
Source\S1D13700.c:309: error: `GLCD_CTRL_PORT' undeclared (first use in this function)
Source\S1D13700.c:309: error: `GLCD_CTRL_A0' undeclared (first use in this function)
Source\S1D13700.c:310: error: `GLCD_CTRL_RW' undeclared (first use in this function)
Source\S1D13700.c: In function `glcdControlParamRead':
Source\S1D13700.c:320: error: `GLCD_DATA_DDR' undeclared (first use in this function)
Source\S1D13700.c:321: error: `GLCD_CTRL_PORT' undeclared (first use in this function)
Source\S1D13700.c:321: error: `GLCD_CTRL_A0' undeclared (first use in this function)
Source\S1D13700.c:322: error: `GLCD_CTRL_RD' undeclared (first use in this function)
Source\S1D13700.c:323: error: `GLCD_DATA_PIN' undeclared (first use in this function)
Source\S1D13700.c: In function `glcdReset':
Source\S1D13700.c:349: error: `GLCD_CTRL_PORT' undeclared (first use in this function)
Source\S1D13700.c:349: error: `GLCD_CTRL_RESET' undeclared (first use in this function)
Source\S1D13700.c: In function `glcdClearLayer':
Source\S1D13700.c:367: error: `SAD1' undeclared (first use in this function)
Source\S1D13700.c:372: error: `SAD2' undeclared (first use in this function)
Source\S1D13700.c:377: error: `SAD3' undeclared (first use in this function)
Source\S1D13700.c:383: error: `GLCD_XPIXELS' undeclared (first use in this function)
Source\S1D13700.c:383: error: `GLCD_YPIXELS' undeclared (first use in this function)
Process terminated with status 1 (0 minutes, 0 seconds)
30 errors, 1 warnings

There is a realy strange thing! The main() is not in the file which is passed in the first line. Realy strange because in the real mainfile the declaration should be o.k.
Code
//TestS1D13700.c
int main(void)
{
...
}
Has anybody an idea?
Title: Re: WinAVR Project Migration
Post by: Keyla on June 15, 2007, 07:38:50 pm
Well I don't know, is it to simple? I have no clue hoe to fix it :/
Title: Re: WinAVR Project Migration
Post by: stahta01 on June 15, 2007, 08:07:00 pm
If I had the source code, I may be able to help you fix it.

Found what maybe the source at http://hubbard.engr.scu.edu/embedded/avr/avrlib/

You need to determine which header file contains the missing defines.
Then make sure the folder that contains the header is in the search path.

Tim S
Title: Re: WinAVR Project Migration
Post by: Keyla on June 16, 2007, 12:16:42 pm
O.k. here is my example. The mainfile is the TestS1D13700.c others contribute just functions. I think it will help if I show you the (internal only) dependencies:
TestS1D13700.c
-demos.c
--misc.c
--S1D13700ex.c
---display.c
---S1D13700.h

By the way, is it good style to create allways a header .h file? In most cases I doesn't want to limit the functions visibility...

[attachment deleted by admin]
Title: Re: WinAVR Project Migration
Post by: stahta01 on June 16, 2007, 01:37:24 pm
I got it to compile, but linking is beyond me.

Tim S



[attachment deleted by admin]