[求助]关于用ICC7.14编译器编译ch375程序的问题

我最近在搞ch375模块,我用的就是在贵站上下的源程序,用的文件是这三个CH375HFT.C,CH375HFB.H,CH375HFB.A,而且都按照贵站上的方法正确加载了,但我在ICC7.14上编译时,总是出问题,提示错误若下: E:\PROGRA~1\ICC-AV~1\bin\imakew -f CH375.mak iccavr -o CH375 -g -e:0x20000 -ucrtatmega.o -bfunc_lit:0x8c.0x20000 -dram_end:0x10ff -bdata:0x100.0x10ff -dhwstk_size:30 -beeprom:0.4096 -fihx_coff -S2 @CH375.lk E:\avrdesign\ch375\CH375HFB.A -lcatm128 !ERROR file 'CH375HFB.o': undefined symbol 'push_gset1' !ERROR file 'CH375HFB.o': undefined symbol 'push_gset2' !ERROR file 'CH375HFB.o': undefined symbol 'push_gset3' !ERROR file 'CH375HFB.o': undefined symbol 'push_gset4' !ERROR file 'CH375HFB.o': undefined symbol 'push_gset5' !ERROR file 'CH375HFB.o': undefined symbol 'pop_gset1' !ERROR file 'CH375HFB.o': undefined symbol 'pop_gset2' !ERROR file 'CH375HFB.o': undefined symbol 'pop_gset3' !ERROR file 'CH375HFB.o': undefined symbol 'pop_gset4' !ERROR file 'CH375HFB.o': undefined symbol 'pop_gset5' !ERROR Function 'putchar' not defined. This is a hardware dependent function, and it is not included in the ICCAVR default library. Please implement this function to match your target requirements. You can find examples of this function under the \examples.AVR directory. Make a copy of a suitable example, add it to your project and modify it if needed. The source code must #include the appropriate C header file (e.g. stdio.h) as it contains the special compiler pragma for 'putchar'.

E:\PROGRA~1\ICC-AV~1\bin\imakew.exe: Error code 1 Done: there are error(s). Exit code: 1. Wed May 20 00:25:32 2009 请问这是什么问题啊?该怎么解决?烦请哪位高手帮助一下,非常感谢!!!

可能是编译器版本的原因,下载CH375LIB.ZIP,用\CH375LIB\AVR\FILELIBB_V7试试,这个库的编译器版本是7.13


哦,非常感谢!我试下。


还是不行啊,我编译时还是一样的错误!随后我下了个icc7.13的版本,编译\CH375LIB\AVR\FILELIBB_V7,但还是不行,错误提示如下: E:\PROGRA~1\ICC-AV~2\bin\imakew -f CH375.mak iccavr -o CH375 -g -e:0x20000 -ucrtatmega.o -bfunc_lit:0x8c.0x20000 -dram_end:0x10ff -bdata:0x100.0x10ff -dhwstk_size:30 -beeprom:0.4096 -fihx_coff -S2 @CH375.lk E:\avrdesign\ch375\CH375HFB.A -lcatmega !ERROR Function 'putchar' not defined. This is a hardware dependent function, and it is not included in the ICCAVR default library. Please implement this function to match your target requirements. You can find examples of this function under the \examples.AVR directory. Make a copy of a suitable example, add it to your project and modify it if needed. The source code must #include the appropriate C header file (e.g. stdio.h) as it contains the special compiler pragma for 'putchar'.

E:\PROGRA~1\ICC-AV~2\bin\imakew.exe: Error code 1 Done: there are error(s). Exit code: 1. Wed May 20 09:50:54 2009 这到底是什么原因?真是郁闷!


这个是'putchar' 函数有问题,你把我们例子程序里面的串口输出即"printf"这个函数注释掉看编译可以不可以


非常感谢!激动死我了,终于可以啦!而且我试了硬件,成功啦!!再次谢谢你们!!!


但我还是想知道,这是什么原因啊?自己试着改了几下,都不行,不应该啊,这应该只是个输出函数啊,怎么会有错误呢?想不通。而且你们都编译通过了,为什么我的就不行呢?都是7.13版本的,难道是因为我这个是盗版的开发环境??


putchar是printf与串口之间的衔接接口,与编译器有关,错误提示不知道你理解没有,这个函数ICC中没有,需要自己根据硬件编写的


估计程序里面少链接了个头文件,加上合适的头文件就应该可以了


我再按你们的方法试下,谢谢你们啦!


我按SCM的做法做了,果然可以啦!是自己加一个putchar函数就可以了。而且这个函数在ICC的examples.avr文件夹中有示例函数。 总算搞定了第一步了,以后还要继续搞下去,研究更深层次的东西。在这里感谢所有帮助我的高手们,谢谢你们!!! 也希望本帖能给那些和我遇到一样问题,在痛苦中挣扎,但又一直坚持不懈的战友们一些帮助。同时,也希望以后能和大家有更多的交流。


只有登录才能回复,可以选择微信账号登录