srsran/srsGUI

Workaround of compile errors in Ubuntu 15.10/Boost 1.58

peremen opened this issue · 1 comments

I recently upgraded to Ubuntu 15.10, which included Boost 1.58. I was having following error while compiling srsgui:

$ make
[  1%] Generating waterfallplot/moc_WaterfallplotWrapper.cxx
[  3%] Generating __/include/srsgui/common/moc_Lineplot.cxx
[  5%] Generating __/include/srsgui/common/moc_Pointplot.cxx
[  7%] Generating __/include/srsgui/common/moc_Spectrogramplot.cxx
usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"
src/CMakeFiles/srsgui.dir/build.make:66: recipe for target 'src/__/include/srsgui/common/moc_Spectrogramplot.cxx' failed
make[2]: *** [src/__/include/srsgui/common/moc_Spectrogramplot.cxx] Error 1
CMakeFiles/Makefile2:121: recipe for target 'src/CMakeFiles/srsgui.dir/all' failed
make[1]: *** [src/CMakeFiles/srsgui.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2

It seems that the problem is caused by Qt, and unfortunately it is fixed only in Qt 5.x and will be never backported to Qt 4.x. There is a workaround suggested in Qt bug tracker. I am not sure whether there is Qt 5 porting plan, and the patch is just a two liner:

diff --git a/include/srsgui/common/WaterfallData.h b/include/srsgui/common/WaterfallData.h
index 629a676..a289c6d 100755
--- a/include/srsgui/common/WaterfallData.h
+++ b/include/srsgui/common/WaterfallData.h
@@ -2,8 +2,10 @@
 #define WATERFALLDATA_H

 #include <qwt_raster_data.h>
+#ifndef Q_MOC_RUN
 #include <boost/circular_buffer.hpp>
 #include <boost/shared_ptr.hpp>
+#endif
 #include <vector>
 #include <algorithm>
 #include <cmath>

We finally fixed the issue. Thanks for pointing it out.