From: Maarten B. <sou...@ds...> - 2006-08-03 07:38:11
|
Roelof, You should never put a definition in a header file, only declarations. Go back to your C book and look up the word extern. It's also recommended to put function prototypes for functions you use in one C file but define in another in a header file. Include this header in both C files. Maarten > Hi all, > > The following is a problem I do not understand. When I put > a line with const char *soft..... in a global header file > it is ok. But when this line is in the "main" header file > there are errors reported by sdcc. > See below. The warnings are a totally different issue which > I have to look into. > > And offcourse if someone is kind enough to look at this or > my problem, here are the stripped sources : > > http://www.itholland.nl/download/error-20060801.tar > > I took everything out that is not contributing to the error. > One of the const char lines in either fout-global.h or > fout.h should be enabled at the time. > > The compiler is from today, an older one that I used previously > and also generates this error is dated 18 July. I use the snapshots. > Running on Linux/Ubuntu 5.04 > > Thanks in advance, > roelof > > > > roelofh@baywatch:/media/itholland/tek/meetlijn/oud/CAN/591-can/firmware= /c-test$ > make -f makefout > sdcc -c -mmcs51 --model-small --code-size 0x7000 --xram-size 0x1000 > --xram-loc 0x7000 --iram-size 0xff fout-i2c.c > sdcc -c -mmcs51 --model-small --code-size 0x7000 --xram-size 0x1000 > --xram-loc 0x7000 --iram-size 0xff fout-util.c > sdcc -c -mmcs51 --model-small --code-size 0x7000 --xram-size 0x1000 > --xram-loc 0x7000 --iram-size 0xff fout.c > fout.c:19: warning 112: function 'CpuIdle' implicit declaration > fout.c:19: warning 84: 'auto' variable 'CpuIdle' may be used before > initialization > fout.c:19: warning 84: 'auto' variable 'CpuIdle' may be used before > initialization > sdcc --code-size 0x7000 --xram-size 0x1000 --xram-loc 0x7000 --iram-siz= e > 0xff fout.rel fout-i2c.rel fout-util.rel > Multiple definition of _i2cstatus > make: *** [fout] Error 1 > roelofh@baywatch:/media/itholland/tek/meetlijn/oud/CAN/591-can/firmware= /c-test$ > sdcc -v > SDCC : mcs51/xa51 2.6.1 #4314 (Aug 1 2006) (UNIX) |