This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Build error: error: missing binary operator before token "(

Tags: None
(comma "," separated)
joebauer
Registered Member
Posts
12
Karma
0
I'm trying to build kdenlive on Linux Mint 17.1 Rebecca on x86_64 using the script provided by https://github.com/mltframework/mlt-scripts.git (REV bd173400). All the development dependencies that are mentioned on the installation page of kdenlive are installed on my system. While building, this error occurs:

Code: Select all
cc -I/home/joe/kdenlive/20150905/include -DARCH_X86_64 -Wall -DPIC    -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC    -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"0.9.9\"   -c -o melt.o melt.c
cc -I/home/joe/kdenlive/20150905/include -DARCH_X86_64 -Wall -DPIC    -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC    -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"0.9.9\"   -c -o io.o io.c
cc -o melt melt.o io.o -L/home/joe/kdenlive/20150905/lib -Wl,--no-undefined -Wl,--as-needed -Wl,--no-undefined -Wl,--as-needed -L../framework -lmlt -lpthread
make[1]: Leaving directory `/home/joe/kdenlive/src/mlt/src/melt'
consumer_qglsl.cpp:28:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:156:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:180:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:207:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
make[2]: *** [depend] Error 1
make[1]: *** [depend] Error 1
make: *** [all] Error 1
ERROR: Unable to build mlt
LOG: Process has finished. Reason: FAILURE Some kind of error occured: Unable to build mlt


I've searched for this error and found the (somehow weird) solution that sox dev headers were missing for the other person. On my system, sox dev headers are present, however. Any idea what else could be wrong?

Thanks in advance,
Joe
joebauer
Registered Member
Posts
12
Karma
0
Addition: I think there's other people with the exact same problem. I've found two pastebins on

http://pastebin.com/QGeyvKMU and http://pastebin.com/33dUpDkW

which show the same error message -- but no cross-references (just pastebin), so no clue on how (if?) they solved the issue.

I've just erased all source files and did a completely clean build, the error persists. Also note that linking of the "melt" binary works fine, the error occurs only *afterwards*. I'll try to get this resolved on my own and post my digging/finding here so that if anyone finds this thread in the future they can at least reproduce my steps.
joebauer
Registered Member
Posts
12
Karma
0
So, more info. The command that fails is

Code: Select all
[~/kdenlive/src/mlt/src/modules/qt]: g++ -MM -I../.. -DARCH_X86_64 -Wall -DPIC -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DUSE_QT_OPENGL -DUSE_FFTW -Wno-deprecated factory.c producer_qimage.c producer_kdenlivetitle.c common.cpp filter_audiowaveform.cpp qimage_wrapper.cpp kdenlivetitle_wrapper.cpp producer_qtext.cpp consumer_qglsl.cpp filter_lightshow.cpp >x
consumer_qglsl.cpp:28:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:156:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:180:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^
consumer_qglsl.cpp:207:34: error: missing binary operator before token "("
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
                                  ^


i.e. within the dependency checking stuff. When I try to see why the macro is undefined by trying to get the preprocessor output

Code: Select all
g++ -E -I../.. -DARCH_X86_64 -Wall -DPIC -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DUSE_QT_OPENGL -DUSE_FFTW -Wno-deprecated factory.c producer_qimage.c producer_kdenlivetitle.c common.cpp filter_audiowaveform.cpp qimage_wrapper.cpp kdenlivetitle_wrapper.cpp producer_qtext.cpp consumer_qglsl.cpp filter_lightshow.cpp >x


I get a ton of errors:

Code: Select all
common.cpp:20:24: fatal error: QApplication: No such file or directory
 #include <QApplication>
                        ^
compilation terminated.
filter_audiowaveform.cpp:25:20: fatal error: QPainter: No such file or directory
 #include <QPainter>
                    ^
compilation terminated.
qimage_wrapper.cpp:31:18: fatal error: QImage: No such file or directory
 #include <QImage>
                  ^
compilation terminated.
kdenlivetitle_wrapper.cpp:24:18: fatal error: QImage: No such file or directory
 #include <QImage>
                  ^
compilation terminated.
producer_qtext.cpp:26:18: fatal error: QImage: No such file or directory
 #include <QImage>
                  ^
compilation terminated.
consumer_qglsl.cpp:22:24: fatal error: QApplication: No such file or directory
 #include <QApplication>
                        ^
compilation terminated.
filter_lightshow.cpp:24:20: fatal error: QPainter: No such file or directory
 #include <QPainter>
                    ^
compilation terminated.


So it apparently doesn't find any headers. Odd. But do I have them installed? I think yes:

Code: Select all
$ locate QApplication
/usr/include/qt4/QtGui/QApplication


When trying to include all the missing paths I eventually end up with

Code: Select all
g++ -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I/usr/include/qt4/QtGui -E -I../.. -DARCH_X86_64 -Wall -DPIC -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DUSE_QT_OPENGL -DUSE_FFTW -Wno-deprecated factory.c producer_qimage.c producer_kdenlivetitle.c common.cpp filter_audiowaveform.cpp qimage_wrapper.cpp kdenlivetitle_wrapper.cpp producer_qtext.cpp consumer_qglsl.cpp filter_lightshow.cpp >x


which still throws one error

Code: Select all
consumer_qglsl.cpp:23:21: fatal error: QGLWidget: No such file or directory
 #include <QGLWidget>
                     ^
compilation terminated.


And this QGLWidget isn't installed on my system. So I installed the packet libqt4-opengl-dev and it's present. Now

Code: Select all
g++ -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I/usr/include/qt4/QtGui -E -I../.. -DARCH_X86_64 -Wall -DPIC -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DUSE_QT_OPENGL -DUSE_FFTW -Wno-deprecated factory.c producer_qimage.c producer_kdenlivetitle.c common.cpp filter_audiowaveform.cpp qimage_wrapper.cpp kdenlivetitle_wrapper.cpp producer_qtext.cpp consumer_qglsl.cpp filter_lightshow.cpp >x


runs flawlessly (no error). Also, of course, when not using -E, but -MM.

However: These includes are not passed to g++ when it runs through the Makefile. I'm guessing some kind of qt-config magic should take care of this, but apparently doesn't. So therefore the whole build still fails. Any ideas why this would be happening?
joebauer
Registered Member
Posts
12
Karma
0
Ah! I was too soon with my assessment. Yes, the build still failed, but not at that location. So apparently, in my case, the missing packet

Code: Select all
libqt4-opengl-dev


was causing the weird issue ("missing binary operator before token"). It seems not to be checked for in any configure steps of the scripts and causes the weird confusion. Then, later in the process, the build failed during a configure phase because it was missing

Code: Select all
libqjson-dev


Also note that in the build prerequisties listed on https://kdenlive.org/download-source#dependencies the package libjack-dev should actually be libjack-jackd2-dev for recent versions of Jack.

Another hint: Install kdelibs5-plugins if you don't want kdenlive to segfault right after starting up. Also included in the updated dependency command line. (See viewtopic.php?f=269&t=128145&p=341279#p341279)

So I propose to change the prerequsites commandline to

Code: Select all
# apt-get install subversion git cmake build-essential yasm libqt4-dev kdelibs5-dev libsdl1.2-dev libsdl-image1.2-dev libxml2-dev libx264-dev libtheora-dev libxvidcore-dev libogg-dev libvorbis-dev libschroedinger-dev libmp3lame-dev libfaac-dev libfaad-dev libgsm1-dev libopencore-amrnb-dev libopencore-amrwb-dev libsamplerate0-dev libjack-jackd2-dev libsox-dev ladspa-sdk swh-plugins libmad0-dev libpango1.0-dev libvpx-dev libqt4-opengl-dev libqjson-dev kdelibs5-plugins


And everything should build fine. Hope someone reads this and all the digging wasn't for nothing...

Thanks for making kdenlive, it's pretty damn awesome. Cheers, Johannes
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
Joe,

Would you consider updating the developer wiki at https://community.kde.org/Kdenlive/Development/KF5 to match your findings


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]