-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[BUG] Multiple definition of u8g_bitData, u8g_bitNotData, etc #18368
Comments
tried with vscode+plaform.io ? |
No, sorry, I do not have VSC or PIO on my laptop. It might work with that setup. |
i use that... but be warned: its highly addictive, once you tried you will never go back to arduino ide |
Yeah, Arduino IDE is quite simple and limited, I'm not particularly a fan. I usually use arduino-mk for my projects, but honestly I was not able to get Marlin's makefile to work... In any case, I'd like to have some feedback regarding the patch, just to see if it is worth to create a PR for it :) |
I wanted to add that I tried (in fact, switched to) PIO, which pulls a different u8glib (https://github.com/MarlinFirmware/U8glib-HAL). I cannot reproduce this using PIO setup. When I was using Arduino for compiling, I tried to use the library mentioned above instead for compilation, but it did not work to me. Unfortunately, I do not have the exact output right now, but I can try to get it if you think it may help. However, I still think that it would be a good idea to keep those symbols private, as they seem to be internal and are conflicting on at least one build environment. Is there a reason I'm not seeing them for keeping them exported? |
@roobre it might be more effective to just post the PR, they will usually be responded to within a couple days. Just be sure to post it against the bugfix-2.0.x branch. I haven't responded before now because I don't know anything about these u8g libraries, or why there is a custom version for Marlin and we have these duplicated functions. |
This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Description
While trying to compile with latest u8glib, I get linker errors regarding multiple u8glib-related variables, defined here:
Marlin/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
Lines 67 to 68 in c352aeb
These variables collide with some with the same name in u8glib:
https://github.com/olikraus/U8glib_Arduino/blob/f17d404d8a20831bfb07ef5de0d225cada2adaef/src/clib/u8g_com_arduino_sw_spi.c#L62
These symbols do not seem to be used outside their compilation unit neither in U8glib, nor in Marlin, at least as far as I could
grep
. I have solved this locally by patching Marlin and unexport them. See the diff here:roobre/Marlin-E5P@2.0.x...roobre:fix-u8glib-exported
I am running Marlin on my printer with this patch and I haven't found issues so far.
My Configurations
Configuration is basically the sample in the current
2.0.x
branch with some tweaks for the Ender 5 Pro. A diff can be found here: roobre/Marlin-E5P@fix-u8glib-exported...roobre:2.0.x-e5pPerhaps the most relevant changes are:
Steps to Reproduce
Expected behavior: Build succeeds
Actual behavior: Linking fails due to multiple definitions.
Additional Information
It could be that I am not building Marlin correctly, if that is the case please tell me. Otherwise, the patch I linked above is working for me so I could happily create a PR for it.
I also think that it would be better practice to unexport this in U8glib, rather than in Marlin, but since U8g v1 seems to be long unmaintained I think I'd have better success by submitting a patch here.
The text was updated successfully, but these errors were encountered: