Issues Compiling WFServer on Raspberry Pi Bullseye

Hi,

Thanks for all of the recent updates. Great work.

I had a go at compiling WFServer on a Raspberry Pi running Bulleye.

Initially I had an issue with getpid, fork, setsid, gettablesize, close and dup not being declared in main.cpp. I was able to resolve this by adding #include <unistd.h>.

I’m now getting errors
…/wfview/rigctld.cpp:1376:38: error: ‘as_const’ is not a member of ‘std’; did you mean ‘is_const’?
1376 | for (const bandType &band : std::as_const(rigCaps->bands))

Any assistance would be appreciated.

I’m using the build instructions from here
https://wfview.org/wfview-user-manual/headless-server/

I’m trying to compile V2.03.

Mike VK4MWL.

Hi Mike,

What compiler and compiler flags are you using?

—E
de W6EL

Hi Elliott,

g++ (Debian 10.2.1-6) 10.2.1 20210110

This is the source file that is failing to compile.
g++ -c -pipe -s -fvisibility=hidden -fvisibility-inlines-hidden -faligned-new -O2 -Wall -Wextra -D_REENTRANT -fPIC -DWFVIEW_VERSION="2.03" -DBUILD_WFSERVER -D__LINUX_PULSE__ -DQT_DEPRECATED_WARNINGS -DQCUSTOMPLOT_COMPILE_LIBRARY -DOUTSIDE_SPEEX -DRANDOM_PREFIX=wf -DEIGEN_MPL2_ONLY -DEIGEN_DONT_VECTORIZE -DPREFIX="/usr/local" -DHOST="hostname" -DUNAME="whoami" -DGITSHORT="ed9a02a" -DQT_NO_DEBUG -DQT_MULTIMEDIA_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I…/wfview -I. -I…/wfview/resampler -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtMultimedia -I/usr/include/aarch64-linux-gnu/qt5/QtPrintSupport -I/usr/include/aarch64-linux-gnu/qt5/QtWidgets -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtSerialPort -I/usr/include/aarch64-linux-gnu/qt5/QtNetwork -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_commhandler.o moc_commhandler.cpp
…/wfview/rigctld.cpp: In member function ‘int rigCtlClient::dumpState(QStringList&, bool)’:
…/wfview/rigctld.cpp:1376:38: error: ‘as_const’ is not a member of ‘std’; did you mean ‘is_const’?
1376 | for (const bandType &band : std::as_const(rigCaps->bands))
| ^~~~~~~~
| is_const
…/wfview/rigctld.cpp:1389:42: error: ‘as_const’ is not a member of ‘std’; did you mean ‘is_const’?
1389 | for (const bandType &band : std::as_const(rigCaps->bands))
| ^~~~~~~~
| is_const
In file included from …/wfview/pttyhandler.h:14,
from …/wfview/rigcommander.h:12,
from …/wfview/servermain.h:18,
from moc_servermain.cpp:10:

I’m running “qmake …/wfview/wfserver.pro” then “make -j4” as per the Headless Server Instructions. Headless Server | wfview

Regards Mike

as_const was introduced in C++17 so this suggests you have an old compiler. Maybe time to upgrade?

As it happens, that file isn’t actually used by wfserver anyway, so I have removed it from the build.

If you pull the updated master branch, it should now compile.

Thanks Phil,

That has fixed it. I will look at upgrading to Bookworm when I get some time and will recompile with the updated compiler. For now it is working well.

Had a quick DX contact to Spain on 20M.

Thanks for your help.

Mike VK4MWL

1 Like