Windows MinGW64 compilation error

cjhare
Posts: 1
Joined: Sun May 08, 2011 3:39 am

Windows MinGW64 compilation error

Post by cjhare »

Hello,

First time posting here, as it's the first time I've run into a problem with bullet not found on the forums or via google.
Just for reference, C++ compiler issues are far from being a strong suit of mine (mainly Java ..I know, I know)

Setup
Windows 7 64bit
Bullet 2.78 (trunk latest - r2395)
Cmake 2.8

Code: Select all

 cmake . -G "MinGW Makefiles" -DCMAKE_CXX_FLAGS:STRING=-DUSE_ADDR64 -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release 
MinGW32 builds correctly (with the the MinGW32 binaries on the %PATH%).

MinGW64 build fails (with the the MinGW64 binaries on the %PATH%).

Code: Select all

[  1%] Building CXX object src/MiniCL/CMakeFiles/MiniCL.dir/MiniCL.obj
C:\Data\Development\bullet-trunk\src\MiniCL\MiniCL.cpp: In function 'void* localBufMalloc(int)':
C:\Data\Development\bullet-trunk\src\MiniCL\MiniCL.cpp:467:24: error: cast from 'int*' to 'long unsigned int' loses precision
C:\Data\Development\bullet-trunk\src\MiniCL\MiniCL.cpp: In function '_cl_context* clCreateContextFromType(cl_context_properties*, cl_device_type, void d*, cl_int*)':
mingw32-make[2]: *** [src/MiniCL/CMakeFiles/MiniCL.dir/MiniCL.obj] Error 1
mingw32-make[1]: *** [src/MiniCL/CMakeFiles/MiniCL.dir/all] Error 2
mingw32-make: *** [all] Error 2
From looking around I know that the problem relates to the pointer reference being an incorrect size for the 64 bit arch, and there's reference to using a compiler flag of -DUSE_ADDR64 and needless to say I've not figured out how to get this working, so help would be much appreciated!

Thanks in advance
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Windows MinGW64 compilation error

Post by dphil »

I also recall something about a 64-bit flag, although the MiniCL stuff is a fairly recent addition I think, so perhaps it was overlooked(?). There have been other threads regarding your compilation issue though. Perhaps they can offer you some suggestions (if even just manual code modifications yourself to get it to compile): Precision loss search results