cmake bug and compile error on Unix

All about Linux portage
Post Reply
dcm39
Posts: 5
Joined: Tue Oct 15, 2013 8:19 am

cmake bug and compile error on Unix

Post by dcm39 »

Hi,

I am trying to compile CloudCompare on my Mandriva system, but have run into a few problems. The first seems to be a mistake in the CMakeLists.txt in the trunk/qCC/plugins folder:

- the loop in this file is including the CMakeFiles folder => telling the loop to ignore this folder allows the configuration to run.

When compiling the code I get the following errors for file CC/CMakeFiles/CC_DLL.dir/src/PointProjectionTools.cpp.o:

Code: Select all

[  6%] Building CXX object CC/CMakeFiles/CC_DLL.dir/src/PointProjectionTools.cpp.o                     
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp: In static member function ‘static bool CCLib::PointProjectionTools::extractConcaveHull2D(std::vector<CCLib::PointProjectionTools::IndexedCCVector2>&, std::list<CCLib::PointProjectionTools::IndexedCCVector2*>&, PointCoordinateType)’:
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:499:20: error: template argument for ‘template<class _Tp> class std::allocator’ uses local type ‘CCLib::PointProjectionTools::extractConcaveHull2D(std::vector<CCLib::PointProjectionTools::IndexedCCVector2>&, std::list<CCLib::PointProjectionTools::IndexedCCVector2*>&, PointCoordinateType)::flags’
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:499:20: error:   trying to instantiate ‘template<class _Tp> class std::allocator’
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:499:20: error: template argument 2 is invalid
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:499:32: error: invalid type in declaration before ‘;’ token
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:502:15: error: request for member ‘resize’ in ‘pointFlags’, which is of non-class type ‘int’
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:540:30: error: invalid types ‘int[unsigned int]’ for array subscript
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:541:26: error: no matching function for call to ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::erase(std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator&)’
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:541:26: note: candidates are:
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:109:5: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::erase(std::list<_Tp, _Alloc>::iterator) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:109:5: note:   no known conversion for argument 1 from ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator {aka std::_List_const_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>}’ to ‘std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>’
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1160:7: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::erase(std::list<_Tp, _Alloc>::iterator, std::list<_Tp, _Alloc>::iterator) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1160:7: note:   candidate expects 2 arguments, 1 provided
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:566:29: error: invalid types ‘int[unsigned int]’ for array subscript
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:591:28: error: invalid types ‘int[const unsigned int]’ for array subscript
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:617:28: error: invalid types ‘int[const unsigned int]’ for array subscript
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:626:26: error: invalid types ‘int[const unsigned int]’ for array subscript
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:689:98: error: no matching function for call to ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::insert(std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator, CCLib::PointProjectionTools::IndexedCCVector2*)’
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:689:98: note: candidates are:
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:99:5: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, const value_type&) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::value_type = CCLib::PointProjectionTools::IndexedCCVector2*]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:99:5: note:   no known conversion for argument 1 from ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator {aka std::_List_const_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>}’ to ‘std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>’
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1095:7: note: void std::list<_Tp, _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, std::list<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::size_type = long unsigned int, std::list<_Tp, _Alloc>::value_type = CCLib::PointProjectionTools::IndexedCCVector2*]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1095:7: note:   candidate expects 3 arguments, 2 provided
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1116:9: note: template<class _InputIterator> void std::list::insert(std::list<_Tp, _Alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator, _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
/home/users/davidm/lbin/cloudcompare/trunk/trunk/CC/src/PointProjectionTools.cpp:711:29: error: invalid types ‘int[const unsigned int]’ for array subscript
make[2]: *** [CC/CMakeFiles/CC_DLL.dir/src/PointProjectionTools.cpp.o] Error 1
make[1]: *** [CC/CMakeFiles/CC_DLL.dir/all] Error 2
make: *** [all] Error 2
Not sure how to fix this... Any help would be appreciated.

Thanks,
Dave
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: cmake bug and compile error on Unix

Post by daniel »

Hi,

In fact we should emphasize more on this, but you should not set the CMake "build" directory under the "sources" folder or any of its sub-folders (or even simply to point to the same folder). Therefore the CMakeFiles folders should never been encountered by CMake when it explores the "source" folder. Moreover this way you won't have to handle the CMake generated files when trying to push your modifications to the git repository.

And for the compilation issue, it's my fault, I haven't tried to compile on Linux after my last commit (the 'flags' enumerator should not be declared inside the method). Update your trunk and it should be ok (clean your repository and make the CMake "build" directory point to another folder by the way ;).

Keep me updated.
Daniel, CloudCompare admin
dcm39
Posts: 5
Joined: Tue Oct 15, 2013 8:19 am

Re: cmake bug and compile error on Unix

Post by dcm39 »

Thanks Daniel, fully realise what you mean for cmake now! That works fine.

Hit another compile bug though;

Code: Select all

[  8%] Building CXX object CC/CMakeFiles/CC_DLL.dir/src/PointProjectionTools.cpp.o                     
/home/users/davidm/lbin/cloudcompare/trunk/CC/src/PointProjectionTools.cpp: In static member function ‘static bool CCLib::PointProjectionTools::extractConcaveHull2D(std::vector<CCLib::PointProjectionTools::IndexedCCVector2>&, std::list<CCLib::PointProjectionTools::IndexedCCVector2*>&, PointCoordinateType)’:
/home/users/davidm/lbin/cloudcompare/trunk/CC/src/PointProjectionTools.cpp:541:26: error: no matching function for call to ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::erase(std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator&)’
/home/users/davidm/lbin/cloudcompare/trunk/CC/src/PointProjectionTools.cpp:541:26: note: candidates are:
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:109:5: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::erase(std::list<_Tp, _Alloc>::iterator) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:109:5: note:   no known conversion for argument 1 from ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator {aka std::_List_const_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>}’ to ‘std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>’
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1160:7: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::erase(std::list<_Tp, _Alloc>::iterator, std::list<_Tp, _Alloc>::iterator) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1160:7: note:   candidate expects 2 arguments, 1 provided
/home/users/davidm/lbin/cloudcompare/trunk/CC/src/PointProjectionTools.cpp:689:98: error: no matching function for call to ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::insert(std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator, CCLib::PointProjectionTools::IndexedCCVector2*)’
/home/users/davidm/lbin/cloudcompare/trunk/CC/src/PointProjectionTools.cpp:689:98: note: candidates are:
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:99:5: note: std::list<_Tp, _Alloc>::iterator std::list<_Tp, _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, const value_type&) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::value_type = CCLib::PointProjectionTools::IndexedCCVector2*]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/list.tcc:99:5: note:   no known conversion for argument 1 from ‘std::list<CCLib::PointProjectionTools::IndexedCCVector2*>::const_iterator {aka std::_List_const_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>}’ to ‘std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>’
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1095:7: note: void std::list<_Tp, _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, std::list<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::size_type = long unsigned int, std::list<_Tp, _Alloc>::value_type = CCLib::PointProjectionTools::IndexedCCVector2*]
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1095:7: note:   candidate expects 3 arguments, 2 provided
/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../include/c++/4.6.3/bits/stl_list.h:1116:9: note: template<class _InputIterator> void std::list::insert(std::list<_Tp, _Alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator, _Tp = CCLib::PointProjectionTools::IndexedCCVector2*, _Alloc = std::allocator<CCLib::PointProjectionTools::IndexedCCVector2*>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<CCLib::PointProjectionTools::IndexedCCVector2*>]
make[2]: *** [CC/CMakeFiles/CC_DLL.dir/src/PointProjectionTools.cpp.o] Error 1
make[1]: *** [CC/CMakeFiles/CC_DLL.dir/all] Error 2
make: *** [all] Error 2
Similar problem again?

Cheers,
Dave
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: cmake bug and compile error on Unix

Post by daniel »

Indeed! C++98 requires a standard 'iterator' and not a 'const_iterator'... C++11 is more permissive.

Can you try to update your trunk again? (sorry for the remote debugging process, but I don't have a working Linux environment right now).
Daniel, CloudCompare admin
dcm39
Posts: 5
Joined: Tue Oct 15, 2013 8:19 am

Re: cmake bug and compile error on Unix

Post by dcm39 »

One more I'm afraid!

Code: Select all

[ 81%] Building CXX object qCC/CMakeFiles/CloudCompare.dir/qrc_icones.cxx.o
Linking CXX executable CloudCompare
../CC/libCC_DLL.so: undefined reference to `CCLib::DgmOctree::computeCellCenter(short const*, unsigned char, float*) const'
../CC/libCC_DLL.so: undefined reference to `CCLib::DgmOctree::computeCellCenter(unsigned int, unsigned char, float*, bool) const'
../CC/libCC_DLL.so: undefined reference to `CCLib::DgmOctree::generateTruncatedCellCode(short const*, unsigned char) const'
collect2: ld returned 1 exit status
make[2]: *** [qCC/CloudCompare] Error 1
make[1]: *** [qCC/CMakeFiles/CloudCompare.dir/all] Error 2
make: *** [all] Error 2
Thanks!
Dave
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: cmake bug and compile error on Unix

Post by daniel »

I shouldn't trust Visual Studio ;)

Ok, this time I found the time to log on Linux and I fixed the last errors. All should be ok now. Sorry for the inconvenience.
Daniel, CloudCompare admin
dcm39
Posts: 5
Joined: Tue Oct 15, 2013 8:19 am

Re: cmake bug and compile error on Unix

Post by dcm39 »

Still not quite there unfortunately!

Code: Select all

[ 65%] Building CXX object qCC/CMakeFiles/CloudCompare.dir/fileIO/DxfFilter.cpp.o
/home/users/davidm/lbin/cloudcompare/trunk/qCC/fileIO/DxfFilter.cpp: In member function ‘virtual CC_FILE_ERROR DxfFilter::loadFile(const char*, ccHObject&, bool, bool*, double*)’:
/home/users/davidm/lbin/cloudcompare/trunk/qCC/fileIO/DxfFilter.cpp:401:2: error: ‘DxfImporter’ was not declared in this scope
/home/users/davidm/lbin/cloudcompare/trunk/qCC/fileIO/DxfFilter.cpp:401:14: error: expected ‘;’ before ‘importer’
/home/users/davidm/lbin/cloudcompare/trunk/qCC/fileIO/DxfFilter.cpp:402:14: error: ‘DL_Dxf’ was not declared in this scope
/home/users/davidm/lbin/cloudcompare/trunk/qCC/fileIO/DxfFilter.cpp:402:42: error: ‘importer’ was not declared in this scope
make[2]: *** [qCC/CMakeFiles/CloudCompare.dir/fileIO/DxfFilter.cpp.o] Error 1
make[1]: *** [qCC/CMakeFiles/CloudCompare.dir/all] Error 2
make: *** [all] Error 2
Sorry!
Dave
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: cmake bug and compile error on Unix

Post by daniel »

It's me who should apologize! I forgot a #ifdef this time (it's not a Windows/Linux issue at least ;).

Last update, I promise!
Daniel, CloudCompare admin
dcm39
Posts: 5
Joined: Tue Oct 15, 2013 8:19 am

Re: cmake bug and compile error on Unix

Post by dcm39 »

Thank you very much for sorting that out, all compiled perfectly now.

I am however having another problem now, which I suspect is more due to my system - I don't suppose you have any suggestions?

If I try and open a ply file, the file appears in the DB Tree section, but there is no display. I get the following in the terminal:

Code: Select all

X Error: BadLength (poly request too large or internal Xlib length error) 16
  Extension:    134 (Uknown extension)
  Minor opcode: 2 (Unknown request)
  Resource id:  0x9
X Error: GLXBadLargeRequest 150
  Extension:    134 (Uknown extension)
  Minor opcode: 2 (Unknown request)
  Resource id:  0x2
X Error: GLXBadLargeRequest 150
  Extension:    134 (Uknown extension)
  Minor opcode: 2 (Unknown request)
  Resource id:  0x3
X Error: GLXBadLargeRequest 150
  Extension:    134 (Uknown extension)
  Minor opcode: 2 (Unknown request)
  Resource id:  0x4
Any help much appreciated!
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: cmake bug and compile error on Unix

Post by daniel »

Indeed, this time it's seems to be an issue with X (graphic system).

The 'Color ramp' shader that is automatically loaded at startup may not be supported by your driver or graphic card (especially if it's an ATI). Just to be sure, uncheck the "Enable shader for faster display (...)" check box in the Display Options dialog ("Color scale" tab).

Otherwise there's several bugs related to this error with some versions of the libXrender package or with some graphic card driver versions (you can try to update them?)
Daniel, CloudCompare admin
Post Reply