完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,朋友们,我用的是P18F420。我的AD转换程序工作得很好,但是因为我把程序的LCD部分分割成一个新的项目,然后把LCD.H文件包含到AD转换器文件中,它给出了这个:“0:错误:(500)未定义的符号:”。两个文件都在MPLABX项目文件夹中。这就是我在Ad转换器程序中所包含的内容:γ包含“…/LCDY4BITYMODEX.X/4BITYLCD.H”。我的意图是使代码非常模块化,一次写入多次。任何帮助都将是非常感谢。此外,LCD功能定义没有下划线前缀。我真的不知道为什么把它插在这里。我正在使用XC8 V4.05和MPLABX。完全错误消息::(1233)使用18F420勘误工作:::(1234)*损坏的快速中断阴影寄存器::(1273)在自由模式下不可用的全知代码生成:0:错误:(500)未定义的符号:YLCDCH命令(DIST/D)Erg/AudioAddix.x.Sudio.Obj.O.LCD.WrdWr.EdCurr.x.Studio .Obj.LCDCDIIT(DIST/Deule/SudioAdTurn.x.Pult.Obj.)(908)退出状态=1nbPosi/MaFaMeCurrime.MK:131:目标“DIST/Deule/Dealth/AdCurtoTr.x.PRODU”的配方cx.Hex'FultEdv[[ 2 ] ]:离开目录'C://Puls/MPLABXPix/Addix.x'NbPosi/MaFaMeCurrase.MK: 90:目标''.Buffic CONF 'FultEdvest[[ 1 ] ]:离开目录'C:/Ups/Upvs/MPLABXPosi/AdTurn.x'NbPosi/MaqFixIMP.MK:39:目标''.dGue[ 2 ]:**[Dist/Deult/Addix.x.Engult.HEX]错误1]使[1 ]:**[Bug CONF]错误2:使:**[构建IMPL]错误2Bug失败(退出值2,总时间:4s)
以上来自于百度翻译 以下为原文 Hi Friends, I am using P18F4520. My AD conversion program worked fine but since i separated the LCD part of the program into a new project and then included LCD.h file into the AD converter file; it gives this ":0: error: (500) undefined symbols:" . Both files are in the MPLABXProjects folder. This is how i included in the ADConverter program: #include "../LCD_4bit_Mode.X/4bit_LCD.h". My intention is to make the codes very modular and write once and multiple times. Any help will be so much appreciated. In addition, the LCD functions are defined without underscore prefix. i really don't know why it is inserting it here. I am using XC8 v4.05 and MPLABX. full Error Message: :: advisory: (1233) Employing 18F4520 errata work-arounds: :: advisory: (1234) * Corrupted fast interrupt shadow registers :: warning: (1273) Omniscient Code Generation not available in Free mode :0: error: (500) undefined symbols: _LCD_COMMAND(dist/default/productionadConverter.X.production.obj) _LCD_WRITE_STR(dist/default/productionadConverter.X.production.obj) _LCD_INIT(dist/default/productionadConverter.X.production.obj) (908) exit status = 1 nbproject/Makefile-default.mk:131: recipe for target 'dist/default/production/adConverter.X.production.hex' failed make[2]: Leaving directory 'C:/Users/User/MPLABXProjects/adConverter.X' nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed make[1]: Leaving directory 'C:/Users/User/MPLABXProjects/adConverter.X' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed make[2]: *** [dist/default/production/adConverter.X.production.hex] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 4s) |
|
相关推荐
8个回答
|
|
您是否将任何代码(如LCDIGrase/Wrd/init函数)移到Head(.h)文件中?最佳选择
以上来自于百度翻译 以下为原文 Hi Did you move any code, like the LCD_COMMAND/WRITE/INIT functions, to the header (.h) file? Best regards Jorge |
|
|
|
感谢豪尔赫的快速回复。项目PLAUT.MPLABX项目-& LTC.4BITYMOD.X,ADC.XLCD.X & & 4BITYLCD.H,LCD.C…ADC.X-&G.ADC.H,ADCCMY 4BITILLCD.HullSLCDCDUMGRID/WORTE/InIT功能,并且实现在我的ADC内部的LCD.C.I中,包括4BITYLCD。LUD“.. /LCDY4BITYMODEX.X/4BITHLCD.H”
以上来自于百度翻译 以下为原文 Thanks Jorge for your quick reply. projects layout. MPLABXProjects -->LDC.4bit_Mode.X, ADC.X LCD.X --> 4bit_LCD.h, lcd.c ... ADC.X --> adc.h, adc.c My 4bit_LCD.h contains LCD_COMMAND/WRITE/INIT functions, and there implementations are in lcd.c Then inside my adc.h i included the 4bit_LCD.h like #include "../LCD_4bit_Mode.X/4bit_LCD.h" |
|
|
|
这是非常罕见的,比你的头文件需要包括另一个头文件。通常所有的内容都应该只在C文件中完成,在所有头文件中包含公共头,这些头文件可能取决于它们。为什么ADC需要包括4BITLLCD?
以上来自于百度翻译 以下为原文 It is very rare than one of your header files should need to include another header file. Normally all the includes should only be done in C files, with common headers included before any other header files that may depend upon them. Why exactly does adc.h need to include 4bit_LCD.h ? |
|
|
|
感谢您的响应QYB。包括4BITYLCD.H的原因是使我能够在16x2 LCD上显示ADC值。第二,我认为有一个LCD文件是合适的,所以每当我需要在LCD上显示一些东西时,我只包括预先编写的LCD代码,而不是写一个新的LCD功能,或者一直复制和粘贴。例如,如果我需要编写键盘程序,我就不必再写一个LCD功能。代码的可重用性是我的目标。在同一个方法中,我有一个.x文件,其中只有一个配置文件.h文件,它包含我的配置位;并且我在所有项目中都包含了CONFIG.H文件,没有错误。我也把它包含在C源文件中,但仍然有同样的错误。谢谢
以上来自于百度翻译 以下为原文 Thanks for your response qyb. the reason for including 4bit_LCD.h is to enable me display the ADC value on the 16x2 lcd. secondly, i thought it proper to have one lcd file so that whenever i need to display something on lcd, i just include the pre-written lcd code instead of writing a new lcd functions or doing copy and paste all the time. For instance, if i need to write keypad program, i would not have to write another lcd functions. reusability of code is my target. In same method, i have one .X file that contains a config.h file only, which contains my configuration bits; and i've been including the config.h file in all projects without error. I have also included it on the C source file but still the same error. Any help will be appreciated. Thanks |
|
|
|
这不是我问的问题。你把头文件包含到C文件中来共享函数。我特别问为什么一个头文件包含另一个头文件。这不正常,我怀疑你做的不对。你能把整个拉链拉链贴在这儿吗?作为参考,该网页给出了一个好的背景,说明如何管理多个文件项目:在C和C++中组织代码文件(忽略C++特定的位)
以上来自于百度翻译 以下为原文 That is not the question I asked. You include header files into C files to share functions. I specifically asked why one header file is including another header file. That is not normal. I suspect you're just not doing it right. Can you zip the whole lot up and attach it here? For your reference, this web page gives a good background on how you are supposed to manage multi-file projects: Organizing Code Files in C and C++ (Ignore the C++ specific bits) |
|
|
|
嗨QYB,我附上两个项目。谢谢你的帮助。
以上来自于百度翻译 以下为原文 Hi qyb, i have attached both projects. thanks for your help. Attachment(s) code.zip (259.24 KB) - downloaded 17 times |
|
|
|
在你尝试运行之前,先在一个文件夹中启动所有的文件。在整个项目中,你只能有一个主()函数,你只需在整个项目中在一个C文件中设置配置位。现在你有两个主要的功能,每个C文件都在自己的副本中拉。G设置。这不是做多文件项目的方法。一旦所有这些文件都在一个文件夹中工作,那么您可以尝试使文件共享多个项目,但不是现在。
以上来自于百度翻译 以下为原文 Walk before you try to run. Start with all your files in one folder. You can only have one main() function in your whole project, and you should only set your config bits in one C file in your whole project. Right now you have two main functions, and each C file is pulling in its own copy of the config settings. That is NOT the way to do a multi file project. Once you have this all working in a single folder, then you can try making the files common to more than one project, but not now. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5132 浏览 9 评论
1985 浏览 8 评论
1914 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3153 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2213 浏览 5 评论
702浏览 1评论
593浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
476浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
608浏览 0评论
499浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-5 13:30 , Processed in 1.477086 second(s), Total 91, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号