Author Topic: [RESOLVED] Can a 32-bit versiom u C::B be built on a 64-bit Windows platform  (Read 893 times)

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
I can build the latest 64-bit version of C::B, using wx3.2, from SVN source (12878).

My first attempt to build a 32-bit version of C::B, on a 64-nit version of Windows, has been a failure. Using Xaviou's latest 32-bit version of C::B (12864) as a host, I tried using both a 32-bit and a 64-bit compiler (both failed at same point). I'm questioning my own toolchains while using the Mingw64 compilers.

What assumptions (if any) are wrong? Any insight into the best way to accomplish my task will be greatly appreciated !

Regards
« Last Edit: September 10, 2022, 10:03:20 pm by Frank_CB »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #1 on: August 27, 2022, 09:59:55 pm »
I use a 32-bits toolchain on a 64-bits system, mainly because the software I deploy must run on 32-bits systems. As a side effect, I get a 32-bits C::B.

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #2 on: August 27, 2022, 10:19:27 pm »
@Miguel Gimenez:
Thanks ! That answers an important question of mine. Which is, whether a 32-bit C::B could be built on a 64-bit system. I'll have to work on my 32-bit toolchain.

Regards

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #3 on: August 28, 2022, 11:59:08 pm »
I just built a 64-bit version of C::B (12878) from the latest source, without the contributed plugin SpellChecker. It was missing hunspell.h.

However, my attempts at building a 32-bit version of C::B are still failing, no matter which 32-bit compilers or linkers I use.

A snippet of the build log for the last failure follows:
Code
x86_64-w64-mingw32-g++.exe -Wall -std=gnu++11 -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs32\include -I.objs32\include -I. -IC:\wxWidgets-3.2.0\include -IC:\wxWidgets-3.2.0\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iexchndl\win32\include -c C:\projectsx32\12878\src\src\watchesdlg.cpp -o .objs32\src\watchesdlg.o
x86_64-w64-mingw32-g++.exe -LC:\wxWidgets-3.2.0\lib\gcc_dll -Ldevel32 -Lexchndl\win32\lib -o devel32\codeblocks.exe .objs32\src\app.o .objs32\src\appglobals.o .objs32\src\associations.o .objs32\src\backtracedlg.o .objs32\src\breakpointsdlg.o .objs32\src\compilersettingsdlg.o .objs32\src\cpuregistersdlg.o .objs32\src\crashhandler.o .objs32\src\debugger_interface_creator.o .objs32\src\debuggermenu.o .objs32\src\debuggersettingscommonpanel.o .objs32\src\debuggersettingsdlg.o .objs32\src\debuggersettingspanel.o .objs32\src\disassemblydlg.o .objs32\src\dlgabout.o .objs32\src\dlgaboutplugin.o .objs32\src\editkeywordsdlg.o .objs32\src\editorconfigurationdlg.o .objs32\src\environmentsettingsdlg.o .objs32\src\examinememorydlg.o .objs32\src\find_replace.o .objs32\src\goto_file.o .objs32\src\infopane.o .objs32\src\main.o .objs32\src\notebookstyles.o .objs32\src\printdlg.o .objs32\src\projectdepsdlg.o .objs32\src\projectmanagerui.o .objs32\src\projectoptionsdlg.o .objs32\src\recentitemslist.o .objs32\src\scriptconsole.o .objs32\src\scriptingsettingsdlg.o .objs32\src\splashscreen.o .objs32\src\startherepage.o .objs32\src\switcherdlg.o .objs32\src\threadsdlg.o .objs32\src\virtualbuildtargetsdlg.o .objs32\src\watchesdlg.o  .objs32\src\resources\resources.res -Wl,--enable-auto-import -Wl,--no-undefined  -lcodeblocks -lexchndl -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw32u -mwindows
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible exchndl\win32\lib/libexchndl.a when searching for -lexchndl
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible exchndl\win32\lib\libexchndl.a when searching for -lexchndl
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible exchndl\win32\lib/libexchndl.a when searching for -lexchndl
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lexchndl
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (31 minute(s), 21 second(s))
2 error(s), 31 warning(s) (31 minute(s), 21 second(s))
I've also attached an image of the path and fields that were used for the compiler. No matter what I used for the linker for static libraries, the build fails. The ar.exe used as a linker for static libs is from C:\mingw64\x86_64-w64-mingw32. The ar.exe in C:\mingw64\bin also failed as part of the 32-bit toolchain, but worked in the 64-bit toolchain

If anyone is building 32-bit versions of C::B successfully, I'd appreciate you sharing the toolchain thst your using.

Regards
« Last Edit: August 29, 2022, 12:23:43 am by Frank_CB »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #4 on: August 29, 2022, 10:48:12 am »
I use the MinGW64 toolchain targetting Win32 from Sourceforge, it uses GCC 8.1.0.

EDIT: you can checkout r12879 and reenable Spellchecker.
« Last Edit: August 29, 2022, 02:31:43 pm by Miguel Gimenez »

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #5 on: August 29, 2022, 08:00:55 pm »
@Miguel Gimenez:
My apologies!  I am more confused now after reading your last comment. I have MingGW64 from SourceForge. I was under the impression that it was necessary to use different toolchain executables for x86 builds than those used for x64 builds. That assumption of mine might be incorrect?! I had renamed the compiler "FDM", for my own convenience, but it was actually GCC. The attachment to my previous reply actually showed the last toolchain executables I used while trying to build a x86 version of C::B.

I'm building a 64-bit version of 12879 from updated source.

Regards

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #6 on: August 29, 2022, 10:49:38 pm »
@Miguel Gimenez:
Source for SVN 12879 is still missing hunspell.h !

Regards

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #7 on: August 29, 2022, 11:28:41 pm »
Mingw64 has 4 basic flavours, depending on the number of bits used by the toolchain and the number of bits desired for the target. The link I gave you has 64-bit executables and generates 32-bit targets, you may be using another.

Regarding 12879, are you using the official CBP or gd_on's one?

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #8 on: August 30, 2022, 12:00:15 am »
@Miguel Gimenez:
Regardtvg 12879, I'm using the official CBP.

What link did you give me? I'll review the previous replies and see if I might of missed a link?

Regards

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #9 on: September 01, 2022, 08:34:24 pm »
I'm not having any luck building a 32-bit version of SVN source for version 12880 on a 64-bit platform using Windows 10. I have no problems building 64-bit versions.

Would anybody that has successfully built any SVN version of C::B into a 32-bit build , using Windows, please provide a list of the toolchain executables you used ? Also, please include the value of WX_CFG that was used ?

Regards
« Last Edit: September 01, 2022, 08:44:35 pm by Frank_CB »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7298
    • My Best Post
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #10 on: September 02, 2022, 01:56:23 am »
How did you build wxWidgets?
Are you using an 32 bit toolchain that targets 32 bits?

The GCC you posted was 64 bit! Using and 64 bit toolchain to build 32 bit app almost always fails.
Code
x86_64-w64-mingw32-g++.exe

Tim S.

« Last Edit: September 02, 2022, 02:28:33 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #11 on: September 02, 2022, 02:57:17 am »
@stahta01:
Today I just came across a comment on Stackoverflow that stated mingw-w64 couldn't make 32-bit builds, and that mingw32(?) couldn't make 64-bit builds. I thought that I had downloaded a toolchain from Sourceforge that could do both. I thought all I'd have to was change the toolchain executables. Never worked! Tme to re-strategize!

Also, today, I came across a U-Tube video, hosted by a relative of yours, that covered integrating C::B into Msys2. Can Msys2 handle both the 32-bit and the 64-bit versions of C::B on Windows?

Regards

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7298
    • My Best Post
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #12 on: September 02, 2022, 05:01:59 am »
@stahta01:
Today I just came across a comment on Stackoverflow that stated mingw-w64 couldn't make 32-bit builds, and that mingw32(?) couldn't make 64-bit builds. I thought that I had downloaded a toolchain from Sourceforge that could do both. I thought all I'd have to was change the toolchain executables. Never worked! Tme to re-strategize!

Also, today, I came across a U-Tube video, hosted by a relative of yours, that covered integrating C::B into Msys2. Can Msys2 handle both the 32-bit and the 64-bit versions of C::B on Windows?

Regards

mingw.org does not have 64 bit builds as far as I know.
MinGW64 has either 64 or 32 bit builds. In theory they can have one build that supports both; but, I have never found one that runs under windows.

MSys2 has both 32 bit and 64 bit builds of MinGW64; you have to use the correct prompt for either one.

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

Offline Frank_CB

  • Multiple posting newcomer
  • *
  • Posts: 115
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #13 on: September 02, 2022, 05:23:20 am »
@stahta01:
I'll look into MSYS2.

OSDN. SOURCEFORGE and MinGW now use a different approach to installing MinGW.

Thanks for the information.

Regards

Offline sodev

  • Regular
  • ***
  • Posts: 465
Re: Can a 32-bit versiom u C::B be built on a 64-bit Windows platform
« Reply #14 on: September 02, 2022, 05:20:46 pm »
You are mixing up some terms here, i'll try to clear some things up.

There is MinGW(32) and MinGW-w64, these are names of projects that supply GNU toolchains for windows. The former is the original project, the latter is a fork or at least based on the former project and considered to be the more current and up-to-date variant. Other than that, these projects are not connected and especially their names are totally unrelated to 32 Bit or 64 Bit builds.

A GNU toolchain CAN be multilib, this means by using the cli arguments -m32 or -m64 it can build 32 Bit or 64 Bit. However, the GNU toolchains of these two projects are NOT multilib. Instead, these projects supply "singlelib" toolchains for each architecture. So to build for a specific architecture you have to use the proper toolchain (what i am not sure is in what architecture these toolchains themself are build, e.g. is the 32 Bit toolchain a 32 Bit application and runs on a 32 Bit OS or is it 64 Bit and requires a 64 Bit OS to run).

This is also true for MSYS2, it bundles multiple toolchains and you have to specify which one to use when you start a shell.