☑ Error 2 while compiling CC 2.7 on Ubuntu

All about Linux portage
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

☑ Error 2 while compiling CC 2.7 on Ubuntu

Post by swiss_knight »

Hi,
after a bunch of warnings while generating the compilation files with cmake-gui 3.5.1 :
http://pastebin.com/raw/1v15FWXp
It seems to end :

Code: Select all

Generating done
But after that, when I run make the compilation stops at around 44% :

Here are the last lines from the make command stdout :

Code: Select all

[ 43%] Building CXX object libs/qCC_glWindow/CMakeFiles/QCC_GL_LIB.dir/ccGLUtils.cpp.o
/home/username/Downloads/CloudCompare/libs/qCC_io/ShpFilter.cpp: In member function ‘virtual CC_FILE_ERROR ShpFilter::loadFile(QString, ccHObject&, FileIOFilter::LoadParameters&)’:
/home/username/Downloads/CloudCompare/libs/qCC_io/ShpFilter.cpp:1516:17: error: ‘isnan’ was not declared in this scope
   if (isnan(zMin))
                 ^
/home/username/Downloads/CloudCompare/libs/qCC_io/ShpFilter.cpp:1516:17: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:85,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qchar.h:37,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:41,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QString:1,
                 from /home/username/Downloads/CloudCompare/libs/qCC_db/ccLog.h:29,
                 from /home/username/Downloads/CloudCompare/libs/qCC_db/ccSerializableObject.h:22,
                 from /home/username/Downloads/CloudCompare/libs/qCC_db/ccObject.h:22,
                 from /home/username/Downloads/CloudCompare/libs/qCC_db/ccHObject.h:22,
                 from /home/username/Downloads/CloudCompare/libs/qCC_io/FileIOFilter.h:22,
                 from /home/username/Downloads/CloudCompare/libs/qCC_io/ShpFilter.h:24,
                 from /home/username/Downloads/CloudCompare/libs/qCC_io/ShpFilter.cpp:20:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/build.make:418: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/ShpFilter.cpp.o' failed
make[2]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/ShpFilter.cpp.o] Error 1
CMakeFiles/Makefile2:467: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all' failed
make[1]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 43%] Building CXX object libs/qCC_glWindow/CMakeFiles/QCC_GL_LIB.dir/QCC_GL_LIB_automoc.cpp.o
[ 43%] Linking CXX static library libQCC_GL_LIB.a
[ 43%] Built target QCC_GL_LIB
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Any help is greatly appreciated !
Thanks a lot.

I'm on Ubuntu 16.04.
Last edited by swiss_knight on Fri Jul 15, 2016 9:37 pm, edited 1 time in total.
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by daniel »

What compiler / version are you using?

And can you try to replace isnan by std::isnan in ShpFilter.cpp? Does it change anything?
Daniel, CloudCompare admin
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by swiss_knight »

Hi,

Code: Select all

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.3.1-14ubuntu2.1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) 

Replacing "isnan" by "std::isnan" on line 1516 of the /libs/qCC_io/ShpFilter.cpp in CloudCompare directory seems to work, the make command has passed this file without errors. Thanks.

Here is the next step, in file ./libs/qCC_io/RasterGridFilter.cpp :

Code: Select all

[ 20%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o
/home/username/Downloads/CloudCompare/libs/qCC_io/RasterGridFilter.cpp: In member function ‘virtual CC_FILE_ERROR RasterGridFilter::loadFile(QString, ccHObject&, FileIOFilter::LoadParameters&)’:
/home/username/Downloads/CloudCompare/libs/qCC_io/RasterGridFilter.cpp:387:44: error: ‘class QImage’ has no member named ‘pixelColor’
             QColor origColor = quadTexture.pixelColor(k, j);
                                            ^
/home/username/Downloads/CloudCompare/libs/qCC_io/RasterGridFilter.cpp:430:25: error: ‘class QImage’ has no member named ‘setPixelColor’
             quadTexture.setPixelColor(k, j, qRgba(C.r, C.g, C.b, C.a));
                         ^
libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/build.make:730: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o' failed
make[2]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o] Error 1
CMakeFiles/Makefile2:467: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all' failed
make[1]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by daniel »

What version of Qt are you compiling with?
Daniel, CloudCompare admin
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by swiss_knight »

I think it's Qt5... How could I check that ? There is nothing about Qt in the configure output of cmake-gui.

Here are the search results for "qt" in the entries on cmake-gui :
Image
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by daniel »

I think you need Qt 5.5 at least.

But you would have had an error otherwise. This means the setPixelColor must be in Qt 5.6 only...

Either you replace it by something else (like setPixel) or you comment it. I'll fix this on github.
Daniel, CloudCompare admin
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by swiss_knight »

Hello,

If this may help :

Code: Select all

$ qmake --version
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu
And this other command gives something else :

Code: Select all

$ pkg-config --modversion QtCore
4.8.7
But :

Code: Select all

$ pkg-config --modversion Qt5Core
5.5.1
Hope this helps...

I'll keep track of changes on github if I find how to :) I'm pretty new to this.
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by daniel »

I updated the code myself. Hope it works now on your side.
Daniel, CloudCompare admin
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by swiss_knight »

Good evening Mr. daniel,

Thanks for updating! :)

( I've got some new warnings when generating with cmake-gui : http://pastebin.com/raw/TL9H80ZS )

And the same error appears when 'make'-ing the program, here are the last lines :

Code: Select all

[ 49%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/PovFilter.cpp.o
[ 49%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/E57Filter.cpp.o
[ 49%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/ImageFileFilter.cpp.o
[ 49%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/PVFilter.cpp.o
[ 50%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/DepthMapFileFilter.cpp.o
[ 50%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o
[ 50%] Building CXX object libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/DxfFilter.cpp.o
/home/username/Downloads/CloudCompare/trunk/libs/qCC_io/RasterGridFilter.cpp: In member function ‘virtual CC_FILE_ERROR RasterGridFilter::loadFile(QString, ccHObject&, FileIOFilter::LoadParameters&)’:
/home/username/Downloads/CloudCompare/trunk/libs/qCC_io/RasterGridFilter.cpp:387:44: error: ‘class QImage’ has no member named ‘pixelColor’
             QColor origColor = quadTexture.pixelColor(k, j);
                                            ^
libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/build.make:730: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o' failed
make[2]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/RasterGridFilter.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:411: recipe for target 'libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all' failed
make[1]: *** [libs/qCC_io/CMakeFiles/QCC_IO_LIB.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Here are the options related to 'qt' in cmake-gui :
Image
The one in green was empty, I had to manually insert this path. I hope it's correct.
Here is what lays in there : $ tree -d /usr/lib/x86_64-linux-gnu/qt5
http://pastebin.com/raw/vb0QZuBa

I'm trying to be the most complete, let me know if you need some more informations.

Regards.
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error 2 while compiling CC 2.7 on Ubuntu

Post by daniel »

Okay, 2nd attempt (check github ;)
Daniel, CloudCompare admin
Post Reply