Building 32 bit application with 64 bit development environment - c++

I am developing C++ code with OpenCV package for heterogeneous targets (windows/Mac/Linux - 32bit and 64 bit).
Libraries Required to build my c++:
MingW
OPenCV
and Both are built for 64 bit.
I am able to generate 64 bit exe/dll/.so's on the 64 bit build environments.(Built opencv and mingw for 64 bit) and similarly for 32 bit.
Is it possible to create a 32 bit applications in 64 bit dev environment in windows with Mingw and OpenCV? A note here is that, my supporting sdk's or libraries are built with 64 bit.

In Win64 targetting Win32 you can do that by installing the correct mingw package from here.
Note the "Toolchains targetting Win32".
For example, for 4.9.2 you can take this. (I know as a fact that it works for OpenCV)
In the comments you got you can find also a solution for Linux64 targeting Linux32.

Related

Generate 32bit on 64bit machine

I wish to generate 32 bit Fortran binaries on my 64 bit Win 7 Pro machine (using 64 bit gfortran in Cygwin) so I can then run them on my 32 bit Win 7 machine (using 32 bit Cygwin).
Is this doable with a switch at compile and/or link time?
You can cross-compile your code, but you'll probably need a cross-toolchain (i.e. cross mingw/Cygwin). Then you can add --target= to specify e.g. i686 or i586, depending on what the toolchain supports.
My guess is that it would be easiest to use a 32bit Cygwin installation instead and do a "native" build.

How to install cmake on Windows 64 bit

The download page for cmake only shows a 32 bit installer for windows. Any idea how to install it on 64 windows systems.
There is really no reason for a 64bit native CMake. CMake is only building the configuration, so you can use it to build configurations for 64bit software, even with the 32bit version.
That being said, if you truly want a 64bit native version, you could always download the source and compile it. There is no 64bit installer, however.
The 32 bit version works perfectly even on 64 bit Windows. I've used it, and it works.
EDIT: It looks like CMake is now available in both 32-bit and 64-bit flavors. Just go to their website and you can get the 64-bit version.
A 64-bit Windows installer is now available from the download page: https://cmake.org/download

How to have Eclipse CDT output 64bit binaries on Windows?

I am using CDT on Windows 7 64 bit. I want to use JNA in Java on compiled Dlls. But how do I tell eclipse to build 64bit binaries (my JVM is 64 bits, so they have to be like that).
CDT itself doesn't build anything. What compiler are you using?
I would imagine you would need to use a 64 bit compiler.
MinGW-w64 would be what I would use.
http://mingw-w64.sourceforge.net/
edit: oops didn't see it was asked in 2011

Linking 64bit app with 32bit lib in centos 5.6 64bit

I want to build an application on Centos 5.6 64bit as a 64bit application and link it with a 32bit library.
How can i do this and what is the switches i need to pass to the gcc to compile and link.
Thanks.
You cannot. A 64 bit application must link to 64 bit libraries. If the library you must use is 32 bit, you must compile your application 32 bit as well.

Building 64bit Qt on 32bit Xp computer

I'm trying to build Qt in a shared 64 bit mode on my 32bit XP system.
I can configure the QMake and start the 64bit build. The problem is that when the build starts, the first thing that happens in that the process builds ui, moc and rcc utility compilers in 64 bit mode, then tries to run them on my 32bit machine.
Does anyone know how to configure the build so that it does not build those compilers first?
I don't think Qt support cross-compilation on Windows.
I suggest doing it the other way around, by using a 64bit machine (and a 64 bit version of Windows) to build the 64bit and 32bit versions.