mobile phone keypad: hindi language

博客提及手机键盘的印地语相关内容,聚焦信息技术中移动设备输入语言方面。

mobile phone keypad: hindi language



代码出现如下错误: Arduino:1.8.13 (Windows 10), 开发板:"Arduino Uno" libraries\Keypad\Key.cpp.o (symbol from plugin): In function `Key::Key()': (.text+0x0): multiple definition of `Key::Key()' sketch\Key.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Key.cpp.o (symbol from plugin): In function `Key::Key()': (.text+0x0): multiple definition of `Key::Key()' sketch\Key.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Key.cpp.o (symbol from plugin): In function `Key::Key()': (.text+0x0): multiple definition of `Key::Key(char)' sketch\Key.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Key.cpp.o (symbol from plugin): In function `Key::Key()': (.text+0x0): multiple definition of `Key::Key(char)' sketch\Key.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Key.cpp.o (symbol from plugin): In function `Key::Key()': (.text+0x0): multiple definition of `Key::key_update(char, KeyState, bool)' sketch\Key.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::begin(char*)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::scanKeys()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::isPressed(char)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::findInList(char)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::findInList(int)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::getState()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::keyStateChanged()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::numKeys()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::setDebounceTime(unsigned int)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::setHoldTime(unsigned int)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::addEventListener(void (*)(char))' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::transitionTo(unsigned char, KeyState)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::nextKeyState(unsigned char, bool)' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::updateList()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::getKeys()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::getKey()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries\Keypad\Keypad.cpp.o (symbol from plugin): In function `Keypad::Keypad(char*, unsigned char*, unsigned char*, unsigned char, unsigned char)': (.text+0x0): multiple definition of `Keypad::waitForKey()' sketch\Keypad.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2.exe: error: ld returned 1 exit status exit status 1 为开发板 Arduino Uno 编译时出错。 在文件 -> 首选项开启 “编译过程中显示详细输出”选项 这份报告会包含更多信息。
最新发布
11-17
您遇到的错误是: ``` multiple definition of `Key::Key()' sketch\Key.cpp.o: first defined here ... collect2.exe: error: ld returned 1 exit status ``` 这类错误属于 **“多重定义(Multiple Definition)”链接错误**,说明: 👉 您在自己的项目中**不小心创建了名为 `Key.cpp` 和/或 `Keypad.cpp` 的源文件**,而这些文件名恰好与已安装的 Keypad 库中的 `.cpp` 文件重名。 --- ### 🔍 错误原因分析 Arduino IDE 在编译时会把整个项目目录(即 `.ino` 所在的草稿文件夹)中的所有 `.cpp`、`.c`、`.h` 等文件自动包含进编译过程。 如果您的项目文件夹中存在以下文件: - `Key.cpp` - `Key.h` - `Keypad.cpp` - `Keypad.h` 那么 IDE 会尝试将它们和您通过库管理器安装的 **官方 Keypad 库**一起编译 → 导致函数重复定义(比如 `Key::Key()` 被定义两次),从而引发链接失败! > 💥 这是最常见的初学者陷阱之一:下载了库的 ZIP 包后解压到项目目录,并重命名为 `.ino` 同名文件夹,结果把 `Key.cpp` 留在里面! --- ### ✅ 解决方法:立即删除项目中的冲突文件 请按以下步骤操作: #### 步骤 1:找到您的 Arduino 项目文件夹 通常路径为: ``` C:\Users\你的用户名\Documents\Arduino\sketch_XXXXXX\ ``` 或 ``` 保存 .ino 文件的位置 ``` 打开该文件夹,查看是否有如下文件: - `Key.cpp` - `Key.h` - `Keypad.cpp` - `Keypad.h` 🔍 如果有,请确认:这些是不是您从 GitHub 手动下载的 Keypad 库源码? #### 步骤 2:删除这些文件! ✅ 删除以下内容: - `Key.cpp` - `Key.h` - `Keypad.cpp` - `Keypad.h` - (可选)任何以 `.cpp` 或 `.h` 结尾且名字像库文件的) ⚠️ 注意:只保留您的主 `.ino` 文件 和必要的自定义模块(如您自己写的传感器驱动等),不要混入库源码! #### 示例正确结构: ``` MyCalculator/ ├── MyCalculator.ino ← 只留这个主文件 ├── (其他你自己写的 .h/.cpp 文件,非 Keypad 相关) ``` ❌ 错误结构: ``` MyCalculator/ ├── MyCalculator.ino ├── Key.cpp ← ❌ 冲突!删掉 ├── Key.h ← ❌ 冲突!删掉 ├── Keypad.cpp ← ❌ 冲突!删掉 └── Keypad.h ← ❌ 冲突!删掉 ``` #### 步骤 3:重新编译 关闭并重新打开 Arduino IDE(确保缓存刷新),然后点击 **验证/编译**。 ✅ 此时应该不再出现 “multiple definition” 错误。 --- ### 🛠️ 额外建议:如何安全使用第三方库 | 正确做法 | 错误做法 | |--------|---------| | 使用 **库管理器** 安装 Keypad | 把 Keypad 源码复制到项目文件夹 | | 手动安装时放入 `libraries` 目录 | 放在 `.ino` 同级目录 | | 用 `#include <Keypad.h>` 引入库 | 自己写一个同名类重新实现 | --- ### 🔁 总结解决流程 1. 关闭 Arduino IDE 2. 进入您的项目文件夹(与 `.ino` 同名) 3. 删除所有 `Key.cpp`, `Key.h`, `Keypad.cpp`, `Keypad.h` 4. 重新打开 IDE 并编译 5. 成功! --- ✅ 完成以上操作后,您的代码即可正常编译运行。 如果您仍然遇到问题,请提供: - 项目文件夹截图(隐藏隐私) - 是否曾手动复制过 Keypad 源码? 我可以进一步帮您排查。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值