Joshua Strot
Joshua Strot

Reputation: 2531

64-bit and 32-bit C++ executables with Code::Blocks

I have an executable compiled on a 64-bit machine using Code::Blocks and GCC compiler. I also have someone on a 32-bit machine that can't run the executable. Do I need to make two separate versions of the executable, or is there a way that I can compile it to run on both 32-bit and 64-bit systems?

Upvotes: 0

Views: 4220

Answers (1)

Zhongzhi
Zhongzhi

Reputation: 436

You could use -m32 in gcc command line to build a 32-bit version. Please make sure your code is portable from 64-bit to 32-bit.

Upvotes: 3

Related Questions