sjaehn / BChoppr

An audio stream chopping LV2 plugin
GNU General Public License v3.0
33 stars 3 forks source link

clang-10 fails to compile 1.10.2: error: no member named 'fabsf' in the global namespace; did you mean 'fabs'? #11

Closed yurivict closed 3 years ago

yurivict commented 3 years ago
make[1]: Entering directory '/wrkdirs/usr/ports/audio/bchoppr-lv2/work/BChoppr-1.10.2'
Build BChoppr.lv2 DSP...Build BChoppr.lv2 GUI...c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from src/BChoppr_GUI.cpp:21:
In file included from src/BChoppr_GUI.hpp:43:
src/HaloButton.hpp:111:7: warning: 'draw' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        void draw (const BUtilities::RectArea& area)
             ^
src/BWidgets/Widget.hpp:674:15: note: overridden virtual function is here
        virtual void draw (const BUtilities::RectArea& area);
                     ^
1 warning generated.
 done.
In file included from src/BWidgets/pugl/x11.c:51:
/usr/include/c++/v1/math.h:785:12: error: no member named 'fabsf' in the global namespace; did you mean 'fabs'?
  return ::fabsf(__lcpp_x);
         ~~^

I think this is because you use the C++ compiler to compile the C file x11.c. This isn't allowed and the compiler gets confused.

sjaehn commented 3 years ago

Thanks to remember. I know this is an ugly part and I didn't care about as long as it ran well (all in one makefile $(CXX) line). Thus, I've now some work with the makefile.

sjaehn commented 3 years ago

C code is now separated from C++ code in dfdece8e1b0e485decc9cc6c07138d19b208f61f . I had a bigger fight with the linker . GCC/G++ should work correctly. @yurivict please let me know if it works with Clang too. (override will be fixed later)

yurivict commented 3 years ago

It builds now, thanks.

There are a lot of build warnings though:

gmake[1]: Entering directory '/usr/ports/audio/bchoppr-lv2/work/BChoppr-1.10.2-3-gdfdece8'
Build BChoppr.lv2 DSP...Build BChoppr.lv2 GUI...cc: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -Wl,--start-group: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -lX11: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -lcairo: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -lfontconfig: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -lfreetype: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: -Wl,--end-group: 'linker' input unused [-Wunused-command-line-argument]
cc: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
cc: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
c++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,--start-group: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lX11: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lcairo: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lfontconfig: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lfreetype: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,--end-group: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
c++: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
 done.
In file included from ../../src/BChoppr_GUI.cpp:21:
In file included from ../../src/BChoppr_GUI.hpp:43:
../../src/HaloButton.hpp:111:7: warning: 'draw' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        void draw (const BUtilities::RectArea& area)
             ^
../../src/BWidgets/Widget.hpp:674:15: note: overridden virtual function is here
        virtual void draw (const BUtilities::RectArea& area);
                     ^
1 warning generated.
 done.
gmake[1]: Leaving directory '/usr/ports/audio/bchoppr-lv2/work/BChoppr-1.10.2-3-gdfdece8'
sjaehn commented 3 years ago

Override added in c87c27a9641e3c524a57986ea9fc74343fcf2eb9 . Remove linker parameters from compiler-only calls in e384604632d23303159e83e9935d705bf0a334c4 .