Home > Articles > Programming > C/C++

  • Print
  • + Share This
Like this article? We recommend

A Really Simple Way to Build 64-bit C++

A few years ago, I faced the issue of having a 32-bit development machine when I wanted to build 64-bit binary code for server deployment. The twin motivation was that I wanted not to use compatibility mode, and I was curious to see if a native 64-bit binary would be faster than the 32-bit version.

Clearly, one option was to install a cross-platform toolchain in an IDE, such as Eclipse. After unsuccessfully fiddling around with this approach, I opted for a really simple (quick and dirty) solution: Just copy the source files onto the server and build from there. The implicit assumption was that the underlying source code had no issues when running in native 64-bit mode.

Now, I'm sure can hear gasps of reader astonishment! But it was a tough project, and I had very little time for building a complex multiplatform development environment. One important issue with the file-copying approach was that the server could require the installation of additional toolchain artifacts, such as external libraries. It's not perfect, but it does work, and at least it puts the project on wheels, pending a better solution.

So, simply copying the source files and using a makefile or a shell script can get us out of trouble and give us the required native 64-bit binary.

  • + Share This
  • 🔖 Save To Your Account