完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我想做一个简单的项目,它将运行一个定时器,每秒产生一个中断,并在定时器中断服务例程中切换一个LED。但我还没有能够在最基本的级别上编译这个项目。MCC版本:3.55.1MPLAB X版本:4.20操作系统和版本:Linux MINT19编译器版本:XC16V1.35设备名称:PIC18FJ256GA7021。新项目,微芯片嵌入式& GT;独立项目,PIC24FJ256GA702,皮卡4,XC16,命名并设置它作为主要项目。2。Open MCC。从默认配置生成代码。3。尝试建立它。这会导致错误,比如说“函数‘L13’::未定义的‘y-主’”,这会导致构建失败。你知道我做错了什么吗?
以上来自于百度翻译 以下为原文 Hi, I'm trying to make a simple project that'll run a timer, generate an interrupt every second, and toggle an LED in the timer interrupt service routine. But I haven't been able to get the project to compile at even the most basic level. MCC version: 3.55.1 MPLAB X version: 4.20 Operating System and version: Linux Mint 19 Compiler version: XC16 v1.35 Device name: PIC18FJ256GA702 1. New project, Microchip Embedded -> Standalone Project, PIC24FJ256GA702, PICkit 4, XC16, name it and set it as main project. 2. Open MCC. Generate code from the default configuration. 3. Try to build it. This results in errors that say "In function `L13': : undefined reference to `_main'" which cause the build to fail. Any ideas what I'm doing wrong? Attached Image(s) |
|
相关推荐
1个回答
|
|
我能够通过进入项目属性并取消XC16选项下的“使用遗留LIBC”来解决这个问题。下一个问题不久就出现了。我尝试在MCC中添加一个TMR1模块,并在“我在尝试构建这个项目”时得到了“函数”中的错误:“SytSype初始化:”:“TyMR1x初始化”未定义的引用。木桩。但是我更愿意找到优雅的解决方案。看起来它应该工作的方式是MCC.C包含MCC.H,其中包括TMR1.H,它有TMR1x初始化()的声明,但是不知何故这不是编译器看到的。谢谢你的输入。
以上来自于百度翻译 以下为原文 I was able to solve that issue by going into the project properties and unchecking "Use legacy libc" under the XC16 options. The next issue cropped up shortly afterwards. I tried adding a TMR1 module in MCC and got the error "In function `_SYSTEM_Initialize': : undefined reference to `_TMR1_Initialize'" when I tried to build the project. I found a quick and dirty fix for this is to add "include #"tmr1.c"" to mcc.c. I don't know if this results in working code but it compiles. But I'd rather find the elegant solution. It seems like the way it should work is mcc.c has mcc.h included, which includes tmr1.h, which has the declaration for TMR1_Initialize(), but somehow this isn't what the compiler sees. Thanks in advance for your input. |
|
|
|
只有小组成员才能发言,加入小组>>
5253 浏览 9 评论
2038 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3219 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2267 浏览 5 评论
792浏览 1评论
686浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
617浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
686浏览 0评论
586浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 09:59 , Processed in 1.517545 second(s), Total 48, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号