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 ;)
Quote from: Keyla on June 12, 2007, 08:40:26 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.
o.k. here is the full command line log:
-------------- 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.
//TestS1D13700.c
int main(void)
{
...
}
Has anybody an idea?
Well I don't know, is it to simple? I have no clue hoe to fix it :/
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
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]
I got it to compile, but linking is beyond me.
Tim S
[attachment deleted by admin]