Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
tmacchant
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 24, 2011 2:09 am

Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Post by tmacchant »

I am now trying to build wxMSW-2.8.12 on x86_64-w64-mingw32 on Cygwin. (64 bit version wxMSW-2.8.12 )
The following compile error appeared.

Code: Select all

/cygdrive/e/usr/Tatsu/mingw64home/tools/wx/build-2.8.12/bk-deps x86_64-w64-mingw32-g++ -c -o basedll_msw_thread.o -I./.pch/wxprec_basedll -D__WXMSW__     -DWXBUILDING -I../wxMSW-2.8.12/src/tiff     -I../wxMSW-2.8.12/src/regex -I../wxMSW-2.8.12/src/expat/lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I/cygdrive/e/usr/Tatsu/mingw64home/tools/wx/build-2.8.12/lib/wx/include/x86_64-w64-mingw32-msw-ansi-release-2.8 -I../wxMSW-2.8.12/include -I/cygdrive/c/Programs/gplibs64/include -DWX_PRECOMP -Wall -Wundef -Wno-ctor-dtor-privacy -O2 -fno-strict-aliasing -O3 ../wxMSW-2.8.12/src/msw/thread.cpp
../wxMSW-2.8.12/src/msw/thread.cpp: In static member function 'static THREAD_RETVAL wxThreadInternal::DoThreadStart(wxThread*)':
../wxMSW-2.8.12/src/msw/thread.cpp:525:43: error: cast from 'void*' to 'THREAD_RETVAL' loses precision
../wxMSW-2.8.12/src/msw/thread.cpp: In member function 'wxThreadError wxThreadInternal::WaitForTerminate(wxCriticalSection&, void**, wxThread*)':
../wxMSW-2.8.12/src/msw/thread.cpp:845:21: error: cast from 'void*' to 'DWORD' loses precision
../wxMSW-2.8.12/src/msw/thread.cpp: In member function 'void wxThread::Exit(void*)':
../wxMSW-2.8.12/src/msw/thread.cpp:1165:28: error: cast from 'void*' to 'unsigned int' loses precision
make: *** [basedll_msw_thread.o] Error 1
Any suggestions ?

Thanks in advance.

Tatsuro
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Re: Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Post by briceandre »

With a 64 bits compiler, a void* is 8 bytes long. I suppose wxWidgets coders did not take that into account when coding this part of the code.

The problem is that this error can either be harmfull or problematic depending on what is stored in this void*. I highly suspect that the conversion will not cause any trouble, but I am not sure.
So, my suggestions are :
  • You compile everything with a 32bits compiler
  • Or, you file a bug and wait for a full support of wxWidgets for 64 bits
  • Or you try to configure your compiler so that it does not complain about those conversions (not sure this is feasible, and if the conversion is problematic, the resulting application could crash)
  • Or you patch the wxWidgets code to perform an explicit cast (in this case, I am sure this is feasible, but the same remark as previous point applies for the possible crash of the resulting application)
Personnaly, if you do not have good reasons for something else, I would choose the first solution.
tmacchant
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 24, 2011 2:09 am

Re: Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Post by tmacchant »

So, my suggestions are :
  • You compile everything with a 32bits compiler
  • Or, you file a bug and wait for a full support of wxWidgets for 64 bits
  • Or you try to configure your compiler so that it does not complain about those conversions (not sure this is feasible, and if the conversion is problematic, the resulting application could crash)
  • Or you patch the wxWidgets code to perform an explicit cast (in this case, I am sure this is feasible, but the same remark as previous point applies for the possible crash of the resulting application)
I have already compile wxWidgets with 32 bit compiler for gnuplot for windows 32 bit. I am now trying to build 64 bit compiling.
I will wait for a full support of wxWidgets for 64 bits

Thanks!
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Post by doublemax »

Please try again with wx 2.9.2. If you get the same problems, please file a bug report here:
http://trac.wxwidgets.org/
Use the source, Luke!
tmacchant
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 24, 2011 2:09 am

Re: Complie error: loses precision ( wxMSW-2.8.12 mingw64)

Post by tmacchant »

>>Please try again with wx 2.9.2. If you get the same problems, please file a bug report here:

With wx 2.9.2, the build itself went well. Thanks!!

However, the gdiplus for mingw64 seems to be available yet.
(I have googled on this topic. I could not find a solution.)
I will see how the lack of gdiplus will affect using the wxWidges on mingw64.
Post Reply