Author Topic: Building C::B with MinGW64  (Read 21901 times)

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: Building C::B with MinGW64
« Reply #15 on: August 21, 2013, 05:37:42 am »
Thanks for you support, Tim. Well, since I did a lot of tests, I've rather deleted my working copy then checked-out the SVN trunk again. Then, I followed the sequence : built (with -m32 option and -O2 in cb_release_type) all the workspace (unless Autoversioning and Nassi S.), ran update.bat, copied the wx28_custom DLL in the output directory, then launched this fresh C::B... And bang ! No luck, I fall in error "The application was unable to start correctly (0xc000007b)".
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building C::B with MinGW64
« Reply #16 on: August 21, 2013, 06:17:45 am »
Did you copy the mingw dll from the MinGW compiler bin folder?
Did you compile wxWidgets and CB with the exact same MinGW compiler?
Did you remember to compile wxWidgets with the 32 bit option?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: Building C::B with MinGW64
« Reply #17 on: August 21, 2013, 09:29:38 am »
Did you copy the mingw dll from the MinGW compiler bin folder?

I've copied the one shipped with the C::B nightly build since there's not any mingwm10.dll in my installed tdm64-gcc-4.7.1-3 tree.

Did you compile wxWidgets and CB with the exact same MinGW compiler?

No, I can't ! Never found a way to build wxWidgets 2.8.12 DLL with TDM64-GCC (aka MinGW64) and knowing my project are against wxWidgets 2.9.5 I didn't digged. So, the wxmsw28u_gcc_custom.dll comes from a build done with TDM-GCC (aka MinGW32) under Windows 7 32-bit.

Did you remember to compile wxWidgets with the 32 bit option?

Yep, I've added -m32 at global level, directly in the compiler/linker settings.

Well, at this time (unless trying with cb_x86_wx29 or waiting for cb_x64, but I'll have less of time next days), maybe I should try to install a MingGW32 beside my MinGW64. And awaiting a solution I'll continue to build under a Win 7 32-bit with MinGW32 in a VirtualBox (a little bit slow - because of restricted resource under VirtualBox and necessity to copy the result toward my Windows 64-bit host afterward -, but it works)
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building C::B with MinGW64
« Reply #18 on: August 21, 2013, 10:25:23 am »
Did you copy the mingw dll from the MinGW compiler bin folder?

I've copied the one shipped with the C::B nightly build since there's not any mingwm10.dll in my installed tdm64-gcc-4.7.1-3 tree.

Did you compile wxWidgets and CB with the exact same MinGW compiler?

No, I can't ! Never found a way to build wxWidgets 2.8.12 DLL with TDM64-GCC (aka MinGW64) and knowing my project are against wxWidgets 2.9.5 I didn't digged. So, the wxmsw28u_gcc_custom.dll comes from a build done with TDM-GCC (aka MinGW32) under Windows 7 32-bit.

Did you remember to compile wxWidgets with the 32 bit option?

Yep, I've added -m32 at global level, directly in the compiler/linker settings.

Well, at this time (unless trying with cb_x86_wx29 or waiting for cb_x64, but I'll have less of time next days), maybe I should try to install a MingGW32 beside my MinGW64. And awaiting a solution I'll continue to build under a Win 7 32-bit with MinGW32 in a VirtualBox (a little bit slow - because of restricted resource under VirtualBox and necessity to copy the result toward my Windows 64-bit host afterward -, but it works)

So, it had no chance of working.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: Building C::B with MinGW64
« Reply #19 on: August 21, 2013, 10:08:58 pm »
About C::B SVN 32-bit against wxWidgets 2.8.12 DLL 32-bit using TDM64-GCC for both, yes, I'm convinced too it will not have chance to be achieved... Unless someone succeeded and report his experience here ^o^

Well, at this time, I live with what I have (C::B SVN 32-bit against wxWidgets 2.8.12 DLL 32-bit using TDM-GCC) and hope a day I'll succeed with C::B SVN 64-bit against wxWidgets 2.9.5 64-bit using TDM64-GCC).

--
EDIT : just to be sure, I've nevertheless tried to rebuild wxWidgets 2.8.12 DLL 32-bit with TDM64-GCC (since my last attempt was far away in the past)... And it's like I remembered : no success ! At final step, I get this error message :

Code
i386:x86-64 architecture of input file `gcc_mswudll\monodll_version_rc.o' is incompatible with i386 output

So, it talk about winres (the resource compiler) and I already dealed with this, providing the equivalent of "-m32" option for it which is "-F pe-i386"... But it doesn't change anything : same error at the end.

Searching quickly, I've found this page where someone called billyonthemountain experienced the same situation (building wxWidgets in a side and C::B in another, for both cases), but lacking to pass "RCFLAGS="-F pe-i386"  : http://forums.codeblocks.org/index.php?action=printpage;topic=12701.0 ; in his case, he solved it adding these RCFLAGS that I already provide in my case. Then, it doesn't help me.

If someone has an idea, it's welcome (and even if it's indirectly C::B related ; I'll open a thread in wx forum, when I'll have time...)

To finish, here is my full command line (here in two line to be more easily readable in the forum, but it's one line only) :

Code
mingw32-make -j 12 -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 CFLAGS="-m32 -O2" CXXFLAGS="-m32 -O2" 
CPP="gcc -E -DWX_CPU_X86" LDFLAGS="-m32" RCFLAGS="-F pe-i386 -DWX_CPU_X86"
« Last Edit: August 22, 2013, 02:59:32 pm by eranon »
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: Building C::B with MinGW64
« Reply #20 on: August 23, 2013, 12:28:17 am »
OK, succeeded to build wxWidgets 2.8.12 DLL 32-bit (thanks to Xaviou : http://forums.wxwidgets.org/viewtopic.php?f=23&t=37920). Then, I've restarted from C::B SVN from scratch (I mean, new check-out to be sure), launched codeblocks.workspace in my C::B Nightly Build, checked the binded compiler/linker settings well contains -m32 and the equivalent about windres, and clicked Rebuild Workspace. CobeBlock were built without problem and I ran update.bat. I've copied the wxmsw28u_gcc_custom.dll beside output/codeblocks.exe (now both compiled with the same compiler coming from MinGW64)... And I get the same error 0xc000007b at launching, the application didn't started properly. So, now, I try to figure out if MinGW64 requires a mingwm10.dll or not (and if yes, where could I find it).

If you have an idea, don't hesitate...

--
EDIT : it sounds like mingwm10.dll is not needed anymore with MinGW64
« Last Edit: August 23, 2013, 01:46:40 am by eranon »
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: Building C::B with MinGW64
« Reply #21 on: August 23, 2013, 01:43:12 am »
Solved :)

Reading this thread http://forums.codeblocks.org/index.php?topic=12635.0, I had a look at the embedded manifest in codeblocks.exe and seen it indicated :

Code
processorArchitecture="amd64"

So, I've extracted it (using mt.exe), changed the wrong declaration by "x86", then rembedded it (overwriting the previous in codeblocks.exe). And that was it :o
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline Huki

  • Multiple posting newcomer
  • *
  • Posts: 95
Re: Building C::B with MinGW64
« Reply #22 on: September 15, 2013, 11:51:26 pm »
I have a 32-bit PC, but as the mingw-w64 project has a more complete win32api and python gdb support, I recently switched to it. I downloaded the official mingw-builds version (x32-4.8.1-posix-dwarf-rev2), not TDM. I used it to compile both wxWidgets 2.8 and C::B trunk, and contrib plugins (excluding Nassi S). A few points to note:
- Need to use plain ar.exe for static libs.
- No mingwm10.dll dependency, rather the posix version uses libwinpthread (which can be static linked if required, see below).
- -static flag needs to be specified for static linking of libgcc, libstdc++, etc.
- wxWidgets compiling will pump out a lot of warnings unless -Wno-unused-local-typedefs is specified.

An interesting thing I noticed is that, with dwarf exception handling the Code Completion full project parsing times are over twice as fast compared to sjlj. :o
« Last Edit: September 15, 2013, 11:58:14 pm by Huki »