-
Notifications
You must be signed in to change notification settings - Fork 33
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
Naming conflicts with "default" <Servo.h> #9
Comments
Still gives this error! Why doesn't the author simple gives a non conflicting name? Simple puzzling!... Arduino: 1.8.10 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"
|
Hi, I created an issue on the Arduino GitHub repository to get some more information about the change between the last version: arduino/Arduino#9655 Actually I don't want to change the name of the files But if you need urgently some library for servo on ESP32 I found two similar libraries: |
Interesting that there is no issue with the previous IDE versions. I guess it has to do with the priority the libraries are chosen. I have looked into the two libraries you mentioned and unfortunately they have other problems. The first one uses a different API than the Arduino one (which should not be that much of a problem really, but if I can avoid code changes, why not?) and the second, is published via the GPLv2.1 license which I want to avoid to be able to keep publishing my library with a permissive license. Finally, it is perfectly understandable you do not want to break compatibility for existing users. So unless Arduino IDE manages to fix this on their end soon enough, if you do not mind, I will fork the project, make the changes and publish the Arduino IDE-compatible version on the library manager there, always attributing your original work of course. 👍 |
Yes, I haven't got any problem with the fork and creating your own version but could you wait some time with the publication in Arduino IDE Library Manager. I hope that I will get soon some information from Arduino IDE team and find the way how to deal with this issue. PS: I also tested changing the names of the files from |
Sure, I can wait until then, since I'm waiting for the Spring Festival in China to finish so I can order some essential components. This is not blocking me at this point. I'm OK with the |
The bug with the import is already fixed in the Arduino IDE. The new version going to be released on Monday, Jan, 27. Then we can test this library again. |
Sounds awesome! Thanks for looking into this! :) I'm curious though, what happens if someone has the library installed and want to compile for another architecture where the default Perhaps the following snippet implies that this is somehow handled: func TestArchitecturePriority(t *testing.T) {
res := runResolver("Servo.h", "avr", bundleServo, userServo)
require.NotNil(t, res)
require.Equal(t, userServo, res, "selected library")
res = runResolver("Servo.h", "avr", bundleServo, userServoNonavr)
require.NotNil(t, res)
require.Equal(t, bundleServo, res, "selected library")
res = runResolver("Servo.h", "avr", bundleServo, userAnotherServo)
require.NotNil(t, res)
require.Equal(t, bundleServo, res, "selected library")
res = runResolver("Servo.h", "esp32", bundleServo, userAnotherServo)
require.NotNil(t, res)
require.Equal(t, userAnotherServo, res, "selected library")
res = runResolver("Servo.h", "esp32", userServoAllArch, userAnotherServo)
require.NotNil(t, res)
require.Equal(t, userServoAllArch, res, "selected library")
} |
Yes, according the code snippet which you sent there is some handling of the libraries and the original library from Arduino is prefered. C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\noname\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\noname\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\noname\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10809 -build-path C:\Users\noname\AppData\Local\Temp\arduino_build_517251 -warnings=all -build-cache C:\Users\noname\AppData\Local\Temp\arduino_cache_369272 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\noname\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library\examples\02-ServoPotentiometer\02-ServoPotentiometer.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\noname\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\noname\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\noname\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10809 -build-path C:\Users\noname\AppData\Local\Temp\arduino_build_517251 -warnings=all -build-cache C:\Users\noname\AppData\Local\Temp\arduino_cache_369272 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\noname\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library\examples\02-ServoPotentiometer\02-ServoPotentiometer.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
WARNING: Spurious .pio folder in 'ServoESP32' library
Build options changed, rebuilding all
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\sketch\\02-ServoPotentiometer.ino.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\libraries\\Servo\\src" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\sketch\\02-ServoPotentiometer.ino.cpp" -o nul
...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc-ar" rcs "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\core\\core.a" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\core\\wiring_pulse.c.o"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc-ar" rcs "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\core\\core.a" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\core\\wiring_shift.c.o"
Archiving built core (caching) in: C:\Users\noname\AppData\Local\Temp\arduino_cache_369272\core\core_arduino_avr_nano_cpu_atmega328_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.elf" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\sketch\\02-ServoPotentiometer.ino.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\avr\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\megaavr\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\nrf52\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\sam\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\samd\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251\\libraries\\Servo\\stm32f4\\Servo.cpp.o" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/core\\core.a" "-LC:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251" -lm
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.elf" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.eep"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.elf" "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.hex"
Multiple libraries were found for "Servo.h"
Used: C:\Program Files (x86)\Arduino\libraries\Servo
Not used: C:\Users\noname\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library
Using library Servo at version 1.1.3 in folder: C:\Program Files (x86)\Arduino\libraries\Servo
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\noname\\AppData\\Local\\Temp\\arduino_build_517251/02-ServoPotentiometer.ino.elf"
Sketch uses 3278 bytes (10%) of program storage space. Maximum is 30720 bytes.
Global variables use 229 bytes (11%) of dynamic memory, leaving 1819 bytes for local variables. Maximum is 2048 bytes. |
Nice! It should work seamlessly then! 👍 |
Verified the issue is no more with Arduino IDE 1.8.11 on Linux 👍 |
When compiling for the
DOIT ESP32 DEVKIT V1
board on Arduino IDE1.8.10
I am getting conflicts with the "default" Arduino servo library.Due to this problem, none of the examples compiles.
This is easily fixed by changing the name of the header file to something more unique. Ideally, Arduino IDE would have a way of differentiating them, but yeah, it doesn't.
I suggest by renaming
Servo.h
➡️ESP32ArduinoServo.h
. Based on the name you have chosen for your repository, this sounds like a reasonable choice to me.#10 should solve this issue.
The text was updated successfully, but these errors were encountered: