Python Kid
Python Kid

Reputation: 415

Error while compiling wxWidgets with TDM-GCC

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.

Upvotes: 0

Views: 1753

Answers (2)

Robert Eastwood
Robert Eastwood

Reputation: 1

{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.

Upvotes: 0

Python Kid
Python Kid

Reputation: 415

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++.

Upvotes: 2

Related Questions