打印
[STM8]

STM8程序编译时出现错误

[复制链接]
9635|9
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
Compiling main.c...
cxstm8 -iinc +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ main.c
#error cpstm8 stm8l15x.h:53 "Please select first the target STM8L device used in your application (in stm8l15x.h file)"
main.c:
The command: "cxstm8 -iinc +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ main.c " has failed, the returned value is: 1
exit code=1.
lcd.elf - 3 error(s), 0 warning(s)
我已经把stm8l15x.h文件加载进去了,还是出现错误,那位前辈帮我看看怎么办?
沙发
njp-1@qq.com| | 2013-7-18 11:06 | 只看该作者

----------- Project led - STM8 Cosmic - Configuration Debug -------------
Compiling main.c...
cxstm8 -i"c:\program files\cosmic\cxstm8\hstm8" +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8\Hstm8" -iC:\Users\Clevis\Desktop\stm8l-discovery_discover  -clDebug\ -coDebug\ main.c
#error cpstm8 c:\program files\cosmic\cxstm8\hstm8\stm8l15x.h:53 "Please select first the target STM8L device used in your application (in stm8l15x.h file)"
main.c:
The command: "cxstm8 -i"c:\program files\cosmic\cxstm8\hstm8" +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8\Hstm8" -iC:\Users\Clevis\Desktop\stm8l-discovery_discover  -clDebug\ -coDebug\ main.c " has failed, the returned value is: 1
exit code=1.
led.elf - 3 error(s), 0 warning(s)    各位大大请指教这里怎么回事,stm8l15x.h添加进去了,把头文件也都加入了
    这是菜单Option下面路径配置,我把头文件都放在C:\Program Files\COSMIC\CXSTM8\Hstm8

使用特权

评论回复
板凳
gmgmgm| | 2015-3-13 14:57 | 只看该作者
楼主解决了吗,我也遇到同样的问题,刚建立的工程加入固件库就出现这样的情况,要怎么解决啊?

使用特权

评论回复
地板
tanshukai| | 2015-3-14 08:26 | 只看该作者

使用特权

评论回复
5
s_f_tan| | 2015-3-17 16:57 | 只看该作者
定义个cpu类型吧,在project Setting->C compile->preprocessor defintions 定义个你选定的cpu

使用特权

评论回复
6
zh113214| | 2015-3-17 18:45 | 只看该作者
顶!!!

使用特权

评论回复
7
stm8s105c6| | 2015-9-15 11:14 | 只看该作者
楼主,同求啊!问题怎么解决的呢?

使用特权

评论回复
8
爱好学习者| | 2015-9-16 11:57 | 只看该作者

(M)G$TKN@QBLB12]A)UB~SF.png (29.18 KB )

(M)G$TKN@QBLB12]A)UB~SF.png

使用特权

评论回复
9
爱好学习者| | 2015-9-16 11:59 | 只看该作者
添加之后,只选择你自己要用的mcu.h文件即可,其他的系统自带h文件都删掉试下

使用特权

评论回复
10
xiongzh5508| | 2019-12-6 21:44 | 只看该作者
这个问题可以在stm8l15x.h中第33行到第66行中的几行中选择自己的单片机的种类即可!
比如用stm8l151c8可以选择STM8L15X_HD这个。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:你希望掌握永恒,那你必须控制现在

0

主题

56

帖子

1

粉丝