Candle cnc 1.2b on Linux

If you would like to test latest (still quite old already) Candle on Linux machine, you could face the same problems as I did – so few tips how to make it work.

I still think UGS platform is a better choice in many cases – but sometimes Candle may be better for you.

Anyway, you may face compilation errors and configuration problems with latest 1.2b source code.

First problem, in my case, was unknown optimization switch in Makefile (-Z7) – so erase it (three places in Makefile).

/usr/lib/qt5/bin/uic frmabout.ui -o ui_frmabout.h
/usr/lib/qt5/bin/uic widgets/sliderbox.ui -o ui_sliderbox.h
g++ -c -pipe -Z7 -Fdrelease\candle.pdb -O2 -Wall -W -D_REENTRANT -fPIC -DUNIX -DsNan="65536" -DAPP_VERSION=\"1.2b\" -D_USE_MATH_DEFINES -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSerialPort -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o main.cpp
g++: error: unrecognized command line option ‘-Z7’; did you mean ‘-Z’?

Second problem was compilation error because of language changes:

frmmain.h:73:17: error: looser throw specifier for ‘virtual const char* CancelException::what() const’
   73 |     const char* what() const override
      |                 ^~~~
In file included from /usr/include/c++/9/exception:38,
                 from /usr/include/c++/9/new:40,
                 from /usr/include/c++/9/bits/stl_construct.h:59,
                 from /usr/include/c++/9/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/9/bits/stl_algo.h:62,
                 from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:142,
                 from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from main.cpp:4:
/usr/include/c++/9/bits/exception.h:75:5: note: overridden function is ‘virtual const char* std::exception::what() const noexcept’
   75 |     what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW;
      |     ^~~~

So you have to add “noexcept” to what() declaration

Change this (line 73):

const char* what() const override

to this:

const char* what() const noexcept override

Finally you can find something like this:

et.o moc_slider.o moc_sliderbox.o   /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5SerialPort.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread   
g++: error: /DEBUG: Nie ma takiego pliku ani katalogu
g++: error: /OPT:REF: Nie ma takiego pliku ani katalogu

This is also something you can erase in Makefile in LFLAGS.

This changes will enable Candle to compile on recent Linux distros with GCC9.

But there is also one more annoying issue – Candle won’t write configuration file, if you place it on some usual path (like /usr/bin or /usr/local/bin) – because it want’s to write it there. And users can’t write to those paths.

So you can add those lines in frmmain.cpp:

#ifdef WINDOWS
    m_settingsFileName = qApp->applicationDirPath() + "/settings.ini";
#else
    m_settingsFileName = QDir::homePath() + "/.config/Candle/settings.ini";
#endif

Now your configuration file will be written in your home directory, under ”.config/Candle/” path.

And in case you are a bit lazy (like I would like 😉 ) – here is modified source code with compiled binary (perhaps it will work for you without compilation – if note, use qmake; make commands).

Dodaj komentarz

avatar
  Subscribe  
Notify of