ota42y / seam-carving-gui

Automatically exported from code.google.com/p/seam-carving-gui
0 stars 0 forks source link

Compilation Issues on 64 bit linux system #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are several places in the original CAIR.cpp code where a void pointer
is cast to int, which throws an error during compilation:

~/projects/seam-carving-gui$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DBACKEND_CAIR -DQT_NO_DEBUG
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I.
-I. -o CAIR.o cair/CAIR.cpp
cair/CAIR.cpp: In function ‘void* Edge_Quadrant(void*)’:
cair/CAIR.cpp:429: error: cast from ‘void*’ to ‘int’ loses precision
cair/CAIR.cpp: In function ‘void* Energy_Left(void*)’:
cair/CAIR.cpp:623: error: cast from ‘void*’ to ‘int’ loses precision
cair/CAIR.cpp: In function ‘void* Energy_Right(void*)’:
cair/CAIR.cpp:738: error: cast from ‘void*’ to ‘int’ loses precision
cair/CAIR.cpp: In function ‘void* Add_Quadrant(void*)’:
cair/CAIR.cpp:949: error: cast from ‘void*’ to ‘int’ loses precision
cair/CAIR.cpp: In function ‘void* Remove_Quadrant(void*)’:
cair/CAIR.cpp:1264: error: cast from ‘void*’ to ‘int’ loses precision
make: *** [CAIR.o] Error 1

This was easily fixed by including the inttypes.h header and casting to
intptr_t which should be portable, as changing those 4 lines made it
compile smoothly. Thanks for the software!

Original issue reported on code.google.com by peter.be...@gmail.com on 5 Dec 2008 at 6:13

GoogleCodeExporter commented 9 years ago
I knew that crazy void*->int stuff was going to bite me sometime. I have a fix 
coming
into v2.18 of CAIR that will fix it.

Original comment by Brain.Re...@gmail.com on 4 May 2009 at 11:47

GoogleCodeExporter commented 9 years ago
:) Let me know and I'll do a Qt 4.5.1 build. Hopefully the Mac build won't suck 
as 
much then. Anybody feel like donating a Mac with OS X 10.5?

Original comment by gaber...@gmail.com on 5 May 2009 at 2:27

GoogleCodeExporter commented 9 years ago
I finally got CAIR v2.18 done. Pointers are fixed. I threw in a few other 
changes
that might be of interest :)

https://sourceforge.net/project/showfiles.php?group_id=206754&package_id=247429&
release_id=684131

Original comment by Brain.Re...@gmail.com on 21 May 2009 at 3:43

GoogleCodeExporter commented 9 years ago
Try the latest source package. It should work.

Original comment by gaber...@gmail.com on 11 Oct 2009 at 8:05