Candle cnc 1.2b on Linux

If you would like to test latest (yet already quite old) 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 necessity (I have found problem with UGS and Fusion 360 gcode files)..

Anyway, you may face this kind of 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 be in this case 😉 ) – here is modified source code with compiled binary (perhaps it will work for you without compilation – if not, use “qmake; make” commands).

Subscribe
Notify of
guest

4 Comments
Inline Feedbacks
View all comments
swiedjaja
swiedjaja
4 years ago

Thanks a lot!, at last, I successfully compile Candle-1.2b according to your tips!

swiedjaja
swiedjaja
4 years ago

if you want to compile with qtcreator, better to modify candle.pro, remove -Z7 in QMAKE_CXXFLAGS, QMAKE_CFLAGS and remove QMAKE_LFLAGS += /DEBUG /OPT:REF
to be like this: (line 114-118)
CONFIG(release, debug|release) {
QMAKE_CXXFLAGS += -Fdrelease\\candle.pdb
QMAKE_CFLAGS += -Fdrelease\\candle.pdb
# QMAKE_LFLAGS += /DEBUG /OPT:REF
}

ian
ian
4 years ago

I got it to build ok, but for some reason, I can’t type commands into the console window.

trackback

[…] 1.1.7 版本运行良好,但想使用 1.2 的新功能,所以我尝试更新。 采用 git 版本并进行修改以针对 x64 进行编译 ( https://adrian.siemieniak.net/portal/candle-1-2b-for-linux/ ) […]


4
0
Would love your thoughts, please comment.x
()
x