ARDUINO编译时出现多个库怎么解决-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 37937|回复: 12

[已解决] ARDUINO编译时出现多个库怎么解决

[复制链接]
发表于 2017-9-11 20:29 | 显示全部楼层 |阅读模式
本帖最后由 11066 于 2018-3-16 17:46 编辑

编写1602时,在加载库中又安装了LiquidCrystal.h库文件。编译结果出现错误,对应多个库
 楼主| 发表于 2017-9-11 20:59 | 显示全部楼层

这个是错误信息

QQ图片20170911205802.png
 楼主| 发表于 2017-9-11 21:02 | 显示全部楼层
11066 发表于 2017-9-11 20:59
这个是错误信息

这个是我新添加的库文件,添加过这个后他就出现这个错误了

这个是错误信息
Arduino:1.8.2 (Windows 7), 开发板:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

sketch_sep09a:3: error: expected constructor, destructor, or type conversion before '(' token

C:\Users\Administrator\Desktop\缁冧範\sketch_sep09a\sketch_sep09a.ino: In function 'void setup()':

sketch_sep09a:8: error: 'lcd' was not declared in this scope

"LiquidCrystal.h" 对应多个库
已使用: C:\Users\Administrator\Documents\Arduino\libraries\LiquidCrystal
未使用:E:\软件\arduino\libraries\LiquidCrystal
exit status 1
expected constructor, destructor, or type conversion before '(' token

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at cc.arduino.contributions.libraries.filters.InstalledLibraryPredicate.test(InstalledLibraryPredicate.java:47)
        at cc.arduino.contributions.libraries.filters.InstalledLibraryPredicate.test(InstalledLibraryPredicate.java:39)
        at java.util.function.Predicate.lambda$and$0(Predicate.java:69)
        at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.applyFilterToLibrary(LibrariesIndexTableModel.java:154)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.updateContributions(LibrariesIndexTableModel.java:196)
        at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.update(LibrariesIndexTableModel.java:149)
        at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.updateIndexFilter(LibrariesIndexTableModel.java:60)
        at cc.arduino.contributions.ui.InstallerJDialog.updateIndexFilter(InstallerJDialog.java:246)
        at cc.arduino.contributions.libraries.ui.LibraryManagerUI.updateIndexFilter(LibraryManagerUI.java:135)
        at cc.arduino.contributions.libraries.ui.LibraryManagerUI$2.actionPerformed(LibraryManagerUI.java:125)
        at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1258)
        at javax.swing.JComboBox.setSelectedItem(JComboBox.java:586)
        at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622)
        at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:852)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
        at java.awt.Component.processMouseEvent(Component.java:6533)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:501)
        at java.awt.Component.processEvent(Component.java:6298)
        at java.awt.Container.processEvent(Container.java:2236)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2280)
        at java.awt.Window.dispatchEventImpl(Window.java:2746)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
        at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
        at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
        at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
        at java.awt.Dialog.show(Dialog.java:1084)
        at java.awt.Component.show(Component.java:1671)
        at java.awt.Component.setVisible(Component.java:1623)
        at java.awt.Window.setVisible(Window.java:1014)
        at java.awt.Dialog.setVisible(Dialog.java:1005)
        at processing.app.Base.openLibraryManager(Base.java:1343)
        at processing.app.Base.lambda$rebuildImportMenu$2(Base.java:1062)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
        at java.awt.Component.processMouseEvent(Component.java:6533)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at java.awt.Component.processEvent(Component.java:6298)
        at java.awt.Container.processEvent(Container.java:2236)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2280)
        at java.awt.Window.dispatchEventImpl(Window.java:2746)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。


库文件.png
 楼主| 发表于 2017-9-11 21:22 | 显示全部楼层

谢谢,我知道了  这个LiquidCrystallcd(12,11,10,9,8,7,6,5,4,3,2);   应该写成
LiquidCrystal lcd(12,11,10,9,8,7,6,5,4,3,2);   不过还是想知道怎么卸载从加载库中安装的文件
发表于 2017-9-11 21:24 | 显示全部楼层
自带的库需要在IDE安装文件夹下的libraries里手动删除
发表于 2017-9-12 15:51 | 显示全部楼层
直接找到对应的库文件然后手动删除就行
 楼主| 发表于 2017-9-12 17:37 | 显示全部楼层
O_oYYQ 发表于 2017-9-12 15:51
直接找到对应的库文件然后手动删除就行

嗯,谢谢
发表于 2020-8-3 16:05 | 显示全部楼层
但凡我胆子大一点就不会来白嫖
发表于 2020-11-24 20:49 | 显示全部楼层
我也是显示应用多个库文件,但是我C盘已经没有arduino文件夹了呀,这要怎么办呢,有大神知道吗?
C:\Users\ASUS\Desktop\图片1.png
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-29 07:56 , Processed in 0.083915 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表