0

I've been trying to compile wxWidgets for a while now, I've been using TDM-GCC and have been following the guide here with no such luck. The last few lines of my mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release MONOLITHIC=1 is

../../src/msw/thread.cpp: In member function 'void wxThread::Exit(wxThread::Exit
Code)':
../../src/msw/thread.cpp:1165:28: error: cast from 'wxThread::ExitCode {aka void
*}' to 'unsigned int' loses precision [-fpermissive]
     _endthreadex((unsigned)status);

makefile.gcc:4957: recipe for target 'gcc_mswudll\monodll_thread.o' failed
mingw32-make: *** [gcc_mswudll\monodll_thread.o] Error 1

Anyone got any ideas? Please help, I'm truly baffled.

Python Kid
  • 313
  • 2
  • 7
  • 19

2 Answers2

2

With the help of @ravenspoint, and some googling, I found this, which mentioned passing the variable CXXFLAGS to pass arguments to g++ (and for gcc, use CFLAGS), then from @ravenspoint's answer I added CXXFLAGS+=-fpermissive to my mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release MONOLITHIC=1, to pass -fpermissive to g++.

Community
  • 1
  • 1
Python Kid
  • 313
  • 2
  • 7
  • 19
0

{aka void*} to unsigned int loses precision [-fpermissive]

That occurs when it expects 32 bit and gets a 64 bit, usually a problem in compiling code meant to be 32 bit in the TDM default -m64 bit mode.

For void* to lose precision, it must be a 64 bit variable, and unsigned int must be 32.

If you downgrade the variable by disabling the warning and run it on 64 bit machine, you could get a pointer error crash while running program.

ByteHamster
  • 4,884
  • 9
  • 38
  • 53