Compilation on OpenSuSE 11.4 64 bits fail with cast error

All about Linux portage
Post Reply
pacoes3d
Posts: 7
Joined: Thu Feb 02, 2012 9:16 pm

Compilation on OpenSuSE 11.4 64 bits fail with cast error

Post by pacoes3d »

System: Opensuse 11.4 64bits + gcc

run cmake . then make. I got the following error:

Code: Select all

[ 67%] Building CXX object qCC/CMakeFiles/qCC.dir/fileIO/PVFilter.cpp.o                                                      
[ 67%] Building CXX object qCC/CMakeFiles/qCC.dir/fileIO/PlyFilter.cpp.o                                                     
[ 68%] Building CXX object qCC/CMakeFiles/qCC.dir/fileIO/BinFilter.cpp.o                                                     
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp: In member function ‘virtual CC_FILE_ERROR BinFilter::loadFileV2(QFile&, ccHObject&)’:
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:228:59: error: cast from ‘ccGenericPointCloud*’ to ‘unsigned int’ loses precision
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:247:55: error: cast from ‘const ccMaterialSet*’ to ‘unsigned int’ loses precision
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:263:64: error: cast from ‘NormsIndexesTableType*’ to ‘unsigned int’ loses precision
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:279:70: error: cast from ‘TextureCoordsContainer*’ to ‘unsigned int’ loses precision
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:297:58: error: cast from ‘CCLib::GenericIndexedCloudPersist*’ to ‘unsigned int’ loses precision
/home/paco/3D/CloudCompare/trunk/qCC/fileIO/BinFilter.cpp:318:37: error: cast from ‘ccGenericPointCloud*’ to ‘unsigned int’ loses precision
make[2]: *** [qCC/CMakeFiles/qCC.dir/fileIO/BinFilter.cpp.o] Error 1
make[1]: *** [qCC/CMakeFiles/qCC.dir/all] Error 2
make: *** [all] Error 2
The problem should be in the (unsigned) cast operator, for example in line 228 (first error listed)

Code: Select all

unsigned cloudID = (unsigned)mesh->getAssociatedCloud();
Compiller used: gcc-4.5-19.1.x86_64 / cpp-4.5-19.1.x86_64

¿Any suggestion?.

Thanks in advance,



Francisco Escarpa.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Compilation on OpenSuSE 11.4 64 bits fail with cast erro

Post by daniel »

Oh yes, it was a very dirty piece of code! But your compiler is in a very low 'error level mode' (something like -Werror or -Wpedantic).

I've updated BinFiltr.cpp on the trunk (I replaced 'unsigned' by 'intptr_t' which is more suited for this purpose). Can you try it out on your side?
Daniel, CloudCompare admin
pacoes3d
Posts: 7
Joined: Thu Feb 02, 2012 9:16 pm

Re: Compilation on OpenSuSE 11.4 64 bits fail with cast erro

Post by pacoes3d »

Updated from repository; successfull compilation; qCC allready running and working.

Note: Important to start the program with LANG=C; locale settings (mine is es_ES) create interesting troubles ;-D

Thanks for your quick answer.
puppydogfish
Posts: 1
Joined: Sat Feb 28, 2015 7:41 am

Re: Compilation on OpenSuSE 11.4 64 bits fail with cast error

Post by puppydogfish »

Updated from repository; successfull compilation
Post Reply