Skip to content

The encapsulated library cannot be placed in a folder; it must be in the root directory to function properly. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
keyboard2005 opened this issue Aug 30, 2024 · 1 comment

Comments

@keyboard2005
Copy link

in Folders Erro ❌

image
[Starting] Uploading sketch 'kb_iot_boot.ino' [Warning] Output path is not specified. Unable to reuse previously compiled files. Build will be slower. See README. c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o:(.text.loop+0x20): undefined reference toMQTTManager::isConnected()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o:(.text.loop+0x24): undefined reference to MQTTManager::connect()' c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o:(.text.loop+0x28): undefined reference to MQTTManager::getMqttClient()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o:(.text.loop+0x2c): undefined reference to MQTTManager::updateStatus()' c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o:(.text.loop+0x30): undefined reference to WiFiManager::connect()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o: in function loop': C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:25: undefined reference to MQTTManager::isConnected()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:29: undefined reference to MQTTManager::connect()' c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:31: undefined reference to MQTTManager::getMqttClient()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:34: undefined reference to MQTTManager::updateStatus()' c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:41: undefined reference to WiFiManager::connect()'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:52: undefined reference to WiFiManager::WiFiManager(char const*, char const*)' c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:52: undefined reference to MQTTManager::MQTTManager(char const*, int, Client&)'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o: in function _GLOBAL__sub_I_config': C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:55: undefined reference to WiFiManager::WiFiManager(char const*, char const*)'
c:/users/samur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\samur\AppData\Local\Temp\arduino\sketches\87660D9593A54EAD42EA57C17580D5CA\sketch\kb_iot_boot.ino.cpp.o: in function __static_initialization_and_destruction_0': C:\Users\samur\Documents\GitHub\kb_iot_boot/kb_iot_boot.ino:10: undefined reference to MQTTManager::MQTTManager(char const*, int, Client&)'
collect2.exe: error: ld returned 1 exit status
Error during build: exit status 1
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Uploading sketch 'kb_iot_boot.ino': Exit with code=1
`

No in Folder ✔

image
[Starting] Uploading sketch 'kb_iot_boot.ino' [Warning] Output path is not specified. Unable to reuse previously compiled files. Build will be slower. See README. Sketch uses 278040 bytes (26%) of program storage space. Maximum is 1044464 bytes. Global variables use 28136 bytes (34%) of dynamic memory, leaving 53784 bytes for local variables. Maximum is 81920 bytes. IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I" [Done] Uploading sketch 'kb_iot_boot.ino'

@per1234
Copy link

per1234 commented Aug 30, 2024

@keyboard2005 I don't think this has anything to do with the extension. The extension uses Arduino CLI or Arduino IDE 1.x to compile the sketch, so the sketch compilation behavior is dictated by those tools.

So you must educate yourself on how those tools work, which is documented here:

https://arduino.github.io/arduino-cli/latest/sketch-specification/#additional-code-files

If you read that, you will understand that if you want to add additional source files to a subfolder of the sketch, you must place them under a folder named src, NOT lib.

So use a sketch structure that is specification compliant and everything should work fine.

After you have verified that, please close this issue as off topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants