How do I compile my software for all platforms from Ubuntu Linux 64 bit?

I write a lot of open source software that I make available on my website. How do I get my software compiled for all relevant platforms including:

  • Windows
  • OS X
  • Linux 32 bit deb
  • Linux 64 bit deb
  • Linux 32 bit rpm
  • Linux 64 bit rpm
  • etc

I currently only have Linux 64 bit boxes, so I can only compile the 64 bit deb and rpm myself. I’m relying on users contributing other versions. That isn’t ideal because the versions are not all available right after a new release. Indeed the Windows binary is several versions behind at this point.

Edit: My software is QQWing. It is written in C++. I would love to have a build system that can generate binaries for all platforms, or have a place to run builds for multiple systems.

9

Any professional organisation would have not just build machines but test environments for all those platforms they support.

And that’s why most professional organisations won’t support such a plethora of platforms, it’s just too expensive for the small return that each of them yields except the few big ones like for example Windows, Mac, and RedHat based Linux.

So you’ll have to get the hardware to run all those operating systems, the compilers and other tooling for all of them as well. Or maybe you can get away with running all those OSs in virtual machines, if your hardware is up to the task.

5

GCC is able to compile both 32-bit and 64-bit on the same machines using the -m32 and -m64 flags, respectively (source). Of course, your code should also be tested to make sure there are no bugs introduced between 32 and 64 bits.

You can cross-compile your code into a Windows executable using Wine libraries. The mingw libraries provide compilers that act similarly to gcc, while outputting a Windows-compatible (technically a Wine-compatible) binary. You could have a command like i586-mingw32msvc-gcc -Wall "main.c" -o "Program.exe" to compile your program (source). There are differences between Wine and Windows, so there may be subtle and unexpected bugs from using this method. Once again, thorough testing is critical.

You can see the answers at this SO question for suggestions on how to compile for the Mac.

Disclaimer: I’ve never used any of these in a production capacity, so YMMV.

1

Part of software development is managing complexity. By specifying multiple output targets, you are adding complexity. Asking that there “must be an easier way” in this case is a bit like the Simpsons episode where the lady asks “put all the groceries in one bag, and don’t make it heavy!”.

If you have complexity, sometimes it’s better to manage it correctly, rather than trying to reduce it.

One solution would be to use Vagrant to define a virtual machine specification for each of your target platforms. This would include OS, compiler, and whatever other tools are required.

Then, use a build tool such as Jenkins, TeamCity, Bamboo, etc. to to create build plans for each of your platforms. Link these build plans to your source repository (this is basic CI, and execute them all when changes occur.

Now, you not only have multi-platform support, but you have a build process that both works, and is self-documenting. This way, you don’t have the issue where you spend a bunch of hours configuring a real machine to build on Windows, then when the hard drive fails six months later, you’ve forgotten how you got it all working, and have to start over.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How do I compile my software for all platforms from Ubuntu Linux 64 bit?

I write a lot of open source software that I make available on my website. How do I get my software compiled for all relevant platforms including:

  • Windows
  • OS X
  • Linux 32 bit deb
  • Linux 64 bit deb
  • Linux 32 bit rpm
  • Linux 64 bit rpm
  • etc

I currently only have Linux 64 bit boxes, so I can only compile the 64 bit deb and rpm myself. I’m relying on users contributing other versions. That isn’t ideal because the versions are not all available right after a new release. Indeed the Windows binary is several versions behind at this point.

Edit: My software is QQWing. It is written in C++. I would love to have a build system that can generate binaries for all platforms, or have a place to run builds for multiple systems.

9

Any professional organisation would have not just build machines but test environments for all those platforms they support.

And that’s why most professional organisations won’t support such a plethora of platforms, it’s just too expensive for the small return that each of them yields except the few big ones like for example Windows, Mac, and RedHat based Linux.

So you’ll have to get the hardware to run all those operating systems, the compilers and other tooling for all of them as well. Or maybe you can get away with running all those OSs in virtual machines, if your hardware is up to the task.

5

GCC is able to compile both 32-bit and 64-bit on the same machines using the -m32 and -m64 flags, respectively (source). Of course, your code should also be tested to make sure there are no bugs introduced between 32 and 64 bits.

You can cross-compile your code into a Windows executable using Wine libraries. The mingw libraries provide compilers that act similarly to gcc, while outputting a Windows-compatible (technically a Wine-compatible) binary. You could have a command like i586-mingw32msvc-gcc -Wall "main.c" -o "Program.exe" to compile your program (source). There are differences between Wine and Windows, so there may be subtle and unexpected bugs from using this method. Once again, thorough testing is critical.

You can see the answers at this SO question for suggestions on how to compile for the Mac.

Disclaimer: I’ve never used any of these in a production capacity, so YMMV.

1

Part of software development is managing complexity. By specifying multiple output targets, you are adding complexity. Asking that there “must be an easier way” in this case is a bit like the Simpsons episode where the lady asks “put all the groceries in one bag, and don’t make it heavy!”.

If you have complexity, sometimes it’s better to manage it correctly, rather than trying to reduce it.

One solution would be to use Vagrant to define a virtual machine specification for each of your target platforms. This would include OS, compiler, and whatever other tools are required.

Then, use a build tool such as Jenkins, TeamCity, Bamboo, etc. to to create build plans for each of your platforms. Link these build plans to your source repository (this is basic CI, and execute them all when changes occur.

Now, you not only have multi-platform support, but you have a build process that both works, and is self-documenting. This way, you don’t have the issue where you spend a bunch of hours configuring a real machine to build on Windows, then when the hard drive fails six months later, you’ve forgotten how you got it all working, and have to start over.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How do I compile my software for all platforms from Ubuntu Linux 64 bit?

I write a lot of open source software that I make available on my website. How do I get my software compiled for all relevant platforms including:

  • Windows
  • OS X
  • Linux 32 bit deb
  • Linux 64 bit deb
  • Linux 32 bit rpm
  • Linux 64 bit rpm
  • etc

I currently only have Linux 64 bit boxes, so I can only compile the 64 bit deb and rpm myself. I’m relying on users contributing other versions. That isn’t ideal because the versions are not all available right after a new release. Indeed the Windows binary is several versions behind at this point.

Edit: My software is QQWing. It is written in C++. I would love to have a build system that can generate binaries for all platforms, or have a place to run builds for multiple systems.

9

Any professional organisation would have not just build machines but test environments for all those platforms they support.

And that’s why most professional organisations won’t support such a plethora of platforms, it’s just too expensive for the small return that each of them yields except the few big ones like for example Windows, Mac, and RedHat based Linux.

So you’ll have to get the hardware to run all those operating systems, the compilers and other tooling for all of them as well. Or maybe you can get away with running all those OSs in virtual machines, if your hardware is up to the task.

5

GCC is able to compile both 32-bit and 64-bit on the same machines using the -m32 and -m64 flags, respectively (source). Of course, your code should also be tested to make sure there are no bugs introduced between 32 and 64 bits.

You can cross-compile your code into a Windows executable using Wine libraries. The mingw libraries provide compilers that act similarly to gcc, while outputting a Windows-compatible (technically a Wine-compatible) binary. You could have a command like i586-mingw32msvc-gcc -Wall "main.c" -o "Program.exe" to compile your program (source). There are differences between Wine and Windows, so there may be subtle and unexpected bugs from using this method. Once again, thorough testing is critical.

You can see the answers at this SO question for suggestions on how to compile for the Mac.

Disclaimer: I’ve never used any of these in a production capacity, so YMMV.

1

Part of software development is managing complexity. By specifying multiple output targets, you are adding complexity. Asking that there “must be an easier way” in this case is a bit like the Simpsons episode where the lady asks “put all the groceries in one bag, and don’t make it heavy!”.

If you have complexity, sometimes it’s better to manage it correctly, rather than trying to reduce it.

One solution would be to use Vagrant to define a virtual machine specification for each of your target platforms. This would include OS, compiler, and whatever other tools are required.

Then, use a build tool such as Jenkins, TeamCity, Bamboo, etc. to to create build plans for each of your platforms. Link these build plans to your source repository (this is basic CI, and execute them all when changes occur.

Now, you not only have multi-platform support, but you have a build process that both works, and is self-documenting. This way, you don’t have the issue where you spend a bunch of hours configuring a real machine to build on Windows, then when the hard drive fails six months later, you’ve forgotten how you got it all working, and have to start over.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật