Page 1 of 1

Compilation on OpenSuSE 11.4 64 bits fail with cast error

Posted: Mon Jul 02, 2012 1:49 am
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.

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

Posted: Mon Jul 02, 2012 8:12 am
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?

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

Posted: Mon Jul 02, 2012 1:22 pm
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.

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

Posted: Sat Feb 28, 2015 7:46 am
by puppydogfish
Updated from repository; successfull compilation