CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
622 stars 143 forks source link

compilation error: ‘QOpenGLContext’ does not name a type #313

Closed koendv closed 5 years ago

koendv commented 5 years ago

I'm trying to compile cbang + camotics on raspberry pi 4 running Debian Buster. I'm using the following install:

sudo apt-get -y install scons build-essential libssl-dev qt5-default libqt5websockets5-dev libqt5opengl5-dev libv8-dev git libglu1-mesa-dev libyaml-dev libevent-dev libre2-dev libnode-dev libdxflib-dev git clone https://github.com/CauldronDevelopmentLLC/cbang git clone https://github.com/CauldronDevelopmentLLC/CAMotics export TARGET_ARCH=arm-linux-gnueabihf scons -C cbang export CBANG_HOME=$PWD/cbang cd CAMotics scons

Cbang compiles cleanly, but in camotics I get the following error: `src/camotics/view/GL.h:37:3: error: ‘QOpenGLContext’ does not name a type; did you mean ‘QMessageLogContext’? QOpenGLContext &getGLCtx(); ^~~~~~ QMessageLogContext src/camotics/view/GL.h:39:11: error: ‘QOpenGLFunctions_2_0’ does not name a type typedef QOpenGLFunctions_2_0 GLFuncs; ^~~~~~~~ src/camotics/view/GL.h:40:3: error: ‘GLFuncs’ does not name a type GLFuncs &getGLFuncs(); ^~~

I attach a build log: buildlog.txt Any suggestions?

jcoffland commented 5 years ago

Looks like your Qt does not support OpenGL 2.0. It might only support OpenGL ES.

Even if you got CAMotics built for the RaspberryPi it would be really slow. The RPi does not have enough power. Several other people have tried. I don't think anyone has succeeded. But don't let that stop you. ;)

koendv commented 5 years ago

OK. Thank you for pointing me in the right direction.

Summary: Compiles. Runs. Simulates. The speed is sufficient for my purposes. 2019-10-01-110937_1920x1200_scrot

jcoffland commented 5 years ago

Nice.

koendv commented 5 years ago

Thanks. But it's you who has done the hard work, writing camotics.

FYI: I've put up a binary package, together with build notes, on github, and posted an announcement on the raspberry pi forum. The build notes might be of interest; had to modify SConfig a bit.

jcoffland commented 5 years ago

Thanks for this. You might be interested in how I build part of CAMotics for the Buildbotics CNC controller using a Debian chroot environment. It's cleaner because you don't have to modify your system. Although it's slower since it emulates ARM using qemu rather than cross-compiling. It would be best to combine both options.

The process starts with make gplan which runs these commands:

./scripts/gplan-init-build.sh
git -C rpi-share/cbang fetch
git -C rpi-share/cbang reset --hard FETCH_HEAD
git -C rpi-share/camotics fetch
git -C rpi-share/camotics reset --hard FETCH_HEAD
cp ./scripts/gplan-build.sh rpi-share/
sudo ./scripts/rpi-chroot.sh $(GPLAN_IMG) /mnt/host/gplan-build.sh

Above called scripts are all in https://github.com/buildbotics/bbctrl-firmware/blob/master/scripts/ rpi-chroot.sh does a chroot in to a real raspbian distro. It could be Debian with a cross compiler instead. This would make updating your package much easier.