完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,我在编译时出错了。我在MIN中有下面一行。这里是声明,这是公共API代码,请有人告诉我出了什么问题。我想我早就把它修好了,但似乎又回来了。不确定我做错了什么。完整的代码取自:MaMeLe.E/DoCTeNoT/GPS/HTML/DIXX.HTMLand:GITHUB.COM/MaMeLe/GPSNMaaaPARSER感谢您的时间。
以上来自于百度翻译 以下为原文 Hi, I'm getting this error at compile time. :0: error: (499) undefined symbol: _malloc(dist/default/productionGPS-V-N.production.obj) I have the following line in main.c GPS_Init(&GPS); The declaration is here typedef enum _GPS_Result_t { gpsOK, /*!< OK */ gpsERROR, /*!< An error occurred */ gpsNODATA, /*!< No data from GPS */ gpsOLDDATA, /*!< An old data still remaining */ gpsNEWDATA /*!< New pack of fresh data just received */ } GPS_Result_t; and this is the Public API code GPS_Result_t GPS_Init(GPS_t*GPS){ memset((void *)GPS, 0x00, sizeof(GPS_t)); /* Reset structure for GPS */ BUFFER_Init(&BUFFER, sizeof(BufferData), BufferData); /* Initialize buffer for received data */ return gpsOK; } Please could someone let me know what's wrong. I thought I had fixed it earlier, but seems to have come back. Not sure what I'm doing wrong. The full code is taken from here: majerle.eu/documentation/gps/html/index.html Thank you for your time. /D |
|
相关推荐
16个回答
|
|
|
|
|
|
|
|
|
您试图在小PIC上使用MalCube()?哪一个?如果可能的话,这是个坏主意。检查用户手册。
以上来自于百度翻译 以下为原文 You are trying to use malloc() on a small PIC? which one? It is a bad idea, if it is even possible. Check the User Manual. |
|
|
|
|
|
问:你有什么评论,因为他们没有?让我猜一下:GPS的定义“驻留”在主体()中。
以上来自于百度翻译 以下为原文 Question: which #includes did you comment out because they were not available? And let me guess: the definition of GPS "resides" within main()? |
|
|
|
|
|
您使用的库依赖于MalCube()。参见缓冲区。
以上来自于百度翻译 以下为原文 The library you're using relies on malloc(). See buffer.h. |
|
|
|
|
|
|
|
|
|
|
|
请看AsCH0866的答案!MalCube()(RESP)。XC8不可用堆。考虑到它的运作方式,这是意料之中的事。因此,需要进行一些修改。
以上来自于百度翻译 以下为原文 See the answer of aschen0866! malloc() (resp. a heap) is not available with xc8. Given the way it works, this was to be expected. Thus some modifying will be required. |
|
|
|
|
|
非常感谢所有有帮助的回答。请问PIC24EP64 GP202-I/SP(我有一个样本-因此要求)会有用吗?我想我必须升级,因为我正在努力与TFT(单独的职位)。(也许我会用PIC18LF26K22进行另一个项目:(欢呼/ D)
以上来自于百度翻译 以下为原文 Many thanks for all the helpful responses. Could I ask if the PIC24EP64GP202-I/SP (I have a sample - hence asking) would be useful? I guess I will have to upgrade as I'm struggling with a TFT (separate post). :(( Maybe I will use the PIC18LF26K22 for another project :( Cheers /D |
|
|
|
|
|
在不深入研究源的情况下,评估PIC24/DSPIC的生存能力有点困难,但XC16更像是一些“常规”编译器。检查编译器文档应该提供是否支持堆的信息。(PIC32支持堆概念——正如我最近偶然发现的)。
以上来自于百度翻译 以下为原文 Without digging into the source it is a bit difficult to assess the viability of PIC24/dsPIC, but xc16 is more like some "conventional" compiler. Checking the compiler documentation should bring up the information whether a heap is supported. (PIC32 supports the heap concept - as I recently noticed by chance.) |
|
|
|
|
|
当然,PIC24允许更多,特别是在处理图形显示时,在旧的微芯片库中曾经有一个用于PIC18的SRAMOLLC库。它在工作…我会把它当作最后一次尝试
以上来自于百度翻译 以下为原文 Well, sure a PIC24 allows for much more, especially when dealing with graphical displays In any case, there used to be a SRAMAlloc library for PIC18, in old Microchip libraries. It was working... I'd keep it as a last try |
|
|
|
|
|
是的,PIC24支持MalCube()。然而,它仍然没有使MalCube()成为小型嵌入式系统的一个好主意。
以上来自于百度翻译 以下为原文 Yes the PIC24 supports Malloc(). However it still does not make malloc() a great idea for small embedded systems. |
|
|
|
|
|
NKurZMnNEMA数据评估并不完全是一项需要太多性能的工作。因此,内存分配可能是一个可行的选择——至少从一开始。至少比一些“经验丰富的爱好者”试图修改代码他/她只是部分理解。
以上来自于百度翻译 以下为原文 @NKurzman NEMA data evaluation is not exactly a job requiring too much performance. Thus memory allocation might be a feasible option - at least to start with. At least better than some "Experienced Hobbyist" trying to modify code he/she is only partially understanding. |
|
|
|
|
|
说句公道话,我一边学习一边学习,除了工作以外,我还要做这件事。我确实理解C的某些部分,但是尝试把很多东西组合在一起,包括一个微控制器,它的复杂程度比我能处理的多一点,因此我寻求帮助。
以上来自于百度翻译 以下为原文 To be fair, I'm learning as I go along, I have to work on this apart from my day job. I do understand some part of C but trying to piece a lot of things together including a microcontroller and its intricacies is a little more than I can handle and hence I ask for help. /D |
|
|
|
|
|
DartmoorI对此相当了解。因此,简单地移动到PIC24可能是首选。修改代码或有时甚至更糟-集成可能是一个真正的痛苦。
以上来自于百度翻译 以下为原文 @ Dartmoor I understand this quite well. Thus blandly moving to the PIC24 might be the option preferred. Modifying code or - sometimes even worse - integrating can be a real pain. |
|
|
|
|
|
真的很痛。为什么?我只用了一两次,但是…它做起来很容易…
以上来自于百度翻译 以下为原文 can be a real pain. Why? I used it only once or twice but.. it *did* work kind of easily... |
|
|
|
|
|
@ CinziaGWhy?你不必问什么是MaloC。-运气好-这个包是MPLAB RESP带来的一些“标准组件”。你记得:这里有很多关于遗留LIBs的集成/使用的线程…
以上来自于百度翻译 以下为原文 @ CinziaG Why? You didn't then have to ask what _malloc is. And - with some luck - this package was some "standard component" coming with MPLAB resp. the compiler. Do you recall: there's quite a number of threads here concerning the integration/use of legacy libs ... |
|
|
|
|
|
哦,好的,因为这些原因,我同意这不是遗留下来的LIBS…而是在老MLA(或者你的意思是,可能)。我现在又遇到了一个工作在RF4CE板上
以上来自于百度翻译 以下为原文 Aoh ok, for those reasons, I agree It wasn't in the legacy libs... rather in old MLA (or you meant that, possibly). I've met it again now that am working on the RF4CE board |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 03:41 , Processed in 1.051573 second(s), Total 107, Slave 89 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
9348