WsprryPi icon indicating copy to clipboard operation
WsprryPi copied to clipboard

Does not compile with gcc-8.3.0

Open radio-miskovice opened this issue 5 years ago • 3 comments

A huge number of errors and warnings during compile:

  • mailbox.c:280:52: warning: implicit declaration of function ‘makedev’ [-Wimplicit-function-declaration]

  • In file included from /usr/include/c++/8/vector:64, from wspr.cpp:40: /usr/include/c++/8/bits/stl_vector.h: In member function ‘void std::__cxx1998::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = double; _Alloc = std::allocator]’: /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<double*, std::__cxx1998::vector<double, std::allocator > >’ changed in GCC 7.1

...and a number of the same errors in different other locations:

In file included from /usr/include/c++/8/vector:69, from wspr.cpp:40: /usr/include/c++/8bits/vector.tcc:

/usr/include/c++/8/bits/stl_uninitialized.h:311:2: /usr/include/c++/8/bits/stl_uninitialized.h:287:5: /usr/include/c++/8/bits/stl_uninitialized.h:289:37: /usr/include/c++/8/bits/stl_uninitialized.h:115:5: /usr/include/c++/8/bits/stl_uninitialized.h:134:15: /usr/include/c++/8/bits/stl_uninitialized.h:99:9: ... and more

radio-miskovice avatar Nov 15 '19 23:11 radio-miskovice

I'm having the same problem. I'm not a very savvy linux user at all. Only recently got into it and my UNIX commands that I learned in college in 92 are rusty at best.

uname -a gave me this info about the OS on my rPi 1. (the first gen one) Linux raspberrypiI 4.19.75+ #1270 Tue Sep 24 18:38:54 BST 2019 armv6l GNU/Linux

Has a solve been identified?

Bruiserhq avatar Jan 06 '20 06:01 Bruiserhq

About makedev warning : it is due to a change in glibc after version 2.25:

* The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated.  This
  means that in a future release, the macros “major”, “minor”, and “makedev”
  will only be available from <sys/sysmacros.h>.

The fix is to #include <sys/sysmacros.h> in mailbox.c before #include <sys/mman.h>

About the warnings in STL libraries -check this link suggest adding -Wno-psabi to CXXFLAGS in project's makefile

HTH

damyan-ognyanov avatar Jan 29 '20 08:01 damyan-ognyanov

Did a fresh install of the latest Raspbian and got the same problem. Fix is working as suggested by damyan-ognyanov, so thank you very much. Can the fix be included in the code?

PE5E avatar Mar 26 '20 20:03 PE5E