How to do cross-build from Linux to Windows using mingw32/64? Topic is solved

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

How to do cross-build from Linux to Windows using mingw32/64?

Post by slapin »

Hi, all!
Was there any success setting up mingw32/64 build?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by sercero »

I am able to compile OGRE using MinGW, but from whithin windows so that wouldn't be called a cross-build I think.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by slapin »

@paroj did you have fun with cross building using mingw?

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by slapin »

sercero wrote: Tue Aug 19, 2025 12:44 pm

I am able to compile OGRE using MinGW, but from whithin windows so that wouldn't be called a cross-build I think.

I guess that would make enough start for me if you provide your cmake
command line/script then I hope I can figure out the rest. Additionally what bothers me is availability
of windows dependencies.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2238
Joined: Sun Mar 30, 2014 2:51 pm
x 1217

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by paroj »

Code: Select all

apt install g++-mingw-w64-x86-64

and this toolchain file:

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by sercero »

slapin wrote: Tue Aug 19, 2025 12:51 pm
sercero wrote: Tue Aug 19, 2025 12:44 pm

I am able to compile OGRE using MinGW, but from whithin windows so that wouldn't be called a cross-build I think.

I guess that would make enough start for me if you provide your cmake
command line/script then I hope I can figure out the rest. Additionally what bothers me is availability
of windows dependencies.

I'm using Code::Blocks that comes along with a version of MinGW, so I'm not using CMake at the moment.

I haven't tried the latest version of C::B, but it seems that @paroj is making the effort of maintaining MinGW compatibility.

Most of the problems you might find are when trying to use the DirectX SDK and/or CG. If you avoid those libraries and stick to OpenGL you won't have problems with dependencies (the OGRE CMake build chain downloads and compiles the dependencies for you).

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: How to do cross-build from Linux to Windows using mingw32/64?

Post by slapin »

Thanks a lot for help!