Closed wildestpixel closed 5 years ago
Hi
Thanks for the build report.
There are 3 kinds of notification in the output.
The lines with "changed in GCC 7.1" are a note indicating , I believe, that if you link with libraries built with an earlier version of GCC then there is a potential for errors.
The lines with "directive output may be truncated" are warnings, due to the mpd_oled code assuming that certain values will never be negative. I'll try to enforce the positive values to remove the warnings.
The build is failing because of
g++ -o mpd_oled main.o timer.o status.o status_msg.o utils.o display.o programopts.o ultragetopt.o ArduiPi_OLED.o Adafruit_GFX.o bcm2835.o -lmpdclient -lpthread
/usr/bin/ld: bcm2835.o: in function `bcm2835_i2c_write':
bcm2835.c:(.text+0x27d0): undefined reference to `i2c_smbus_write_i2c_block_data'
It looks like on your system the i2c functions are in a library that needs to be specified when linking. You can hopefully link in the library by building mpd_oled with
LDFLAGS="-li2c" make
Adrian.
Hi,
Many thanks for getting back ref the situation with buster, that’s a fantastic level of support for your fantastic project which is appreciated by all.
What would the command line be as a whole to build for MPD and specify the i2c library ? Or would the line you have given be sufficient ?
Sent from my iPad
On 1 Jul 2019, at 07:27, Adrian Rossiter notifications@github.com wrote:
Hi
Thanks for the build report.
There are 3 kinds of notification in the output.
The lines with "changed in GCC 7.1" are a note indicating , I believe, that if you link with libraries built with an earlier version of GCC then there is a potential for errors.
The lines with "directive output may be truncated" are warnings, due to the mpd_oled code assuming that certain values will never be negative. I'll try to enforce the positive values to remove the warnings.
The build is failing because of
g++ -o mpd_oled main.o timer.o status.o status_msg.o utils.o display.o programopts.o ultragetopt.o ArduiPi_OLED.o Adafruit_GFX.o bcm2835.o -lmpdclient -lpthread /usr/bin/ld: bcm2835.o: in function
bcm2835_i2c_write': bcm2835.c:(.text+0x27d0): undefined reference to
i2c_smbus_write_i2c_block_data' It looks like on your system the i2c functions are in a library that needs to be specified when linking. You can hopefully link in the library by building mpd_oled withLDFLAGS="-li2c" make
Adrian.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hi
I have just installed GCC 8 on Ubuntu and I can see that the line I posted includes the library in the wrong place, and so does not fix the build error. The variable should really be LDLIBS, but the mpd_oled Makefile needs to be fixed to support this.
The i2c library nees to be included when building on RuneAudio, and there are no other changes with respect to a vanilla MPD build, so for now you should be able to build everything with
PLAYER=RUNEAUDIO make
Adrian
Hi
You may need to install libi2c-dev (and also i2c-tools and lm-sensors) , as I have just noticed that you have lines in your output like "warning: implicit declaration of function 'i2c_smbus_write_byte_data'", meaning also that suitable i2c library headers are not being included. With these packages installed you may or may not need to link with -li2c, so try PLAYER=RUNEAUDIO make
and PLAYER=MPD make
. Also, run make clean
between builds.
If this doen't work out, I'll see if I can find an SD card and put a copy of buster on it to look at what is needed, as this will certainly become an issue for more people.
Adrian.
I can confirm that PLAYER=RUNEAUDIO make
works well and now has a result the same for me as when running with the MPD flag under Stretch; i.e. I’ve attached a ssd1306 and we are up and running. Daemon enabled etc.
Great, I am pleased it is working!
I managed to find an SD card and worked through the mpd_oled install on raspbian buster. I can see that there are still warnings for the i2csmbus* functions, because they do not appear in any included header, but everything else is in place and the build completes correctly.
I will update the docuimentation for the debian build and close the issue.
Thanks again for letting me know about this.
Adrian.
Able to compile on Stretch but not Buster. Output at make stage on buster :
`pi@quattro:~/mpd_oled $ PLAYER=MPD make g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMPD -c -o main.o main.cpp In file included from /usr/include/c++/8/vector:69, from display_info.h:29, from display.h:32, from main.cpp:25: /usr/include/c++/8/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const double&}; _Tp = double; _Alloc = std::allocator]':
/usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type 'std::vector::iterator' {aka 'gnu_cxx::normal_iterator<double*, std::vector >'} changed in GCC 7.1
vector<_Tp, _Alloc>::
^ gnu_cxx::normal_iterator<double, std::vector >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ , std::vector >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ , std::vector >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^ >' changed in GCC 7.1
_M_realloc_insert(end(), x);
^
~~~~~~ In file included from /usr/include/c++/8/vector:64, from display_info.h:29, from display.h:32, from main.cpp:25: /usr/include/c++/8/bits/stl_vector.h: In constructor 'OledOpts::OledOpts()': /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '__gnu_cxx::normal_iterator<double~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '__gnu_cxx::normal_iterator<double, std::vector~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '__gnu_cxx::normal_iterator<double~~~~ /usr/include/c++/8/bits/stl_vector.h: In member function 'virtual void OledOpts::process_command_line(int, char**)': /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type 'gnu_cxx::normal_iterator<double*, std::vector~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type 'gnu_cxx::normal_iterator<double*, std::vector~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type 'gnu_cxx::normal_iterator<double*, std::vector~~~~ /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '__gnu_cxx::normal_iterator<double*, std::vector~~~~ g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMPD -c -o timer.o timer.cpp g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMPD -c -o status.o status.cpp status.cpp: In member function 'std::__cxx11::string mpd_info::get_elapsed_time() const': status.cpp:410:36: warning: '%02d' directive output may be truncated writing between 2 and 3 bytes into a region of size between 1 and 6 [-Wformat-truncation=] snprintf(time_str, time_str_len, "%02d:%02d:%02d", hours, mins, secs); ^~~~status.cpp:410:36: note: directive argument in the range [-59, 59] status.cpp:410:36: note: directive argument in the range [-59, 59] status.cpp:410:11: note: 'snprintf' output between 9 and 16 bytes into a destination of size 9 snprintf(time_str, time_str_len, "%02d:%02d:%02d", hours, mins, secs);