vaizq
vaizq

Reputation: 33

Install and run c++ program on machine that doesn't have a compiler

I have made a small c++ program using glfw, glut and dearImgui on linux machine. As i know, i have written this program so it should build on windows as well.

I would like to send this program to my friend who's running windows and doesn't have a compiler. How is it possible to build a program on a computer without a compiler?

Upvotes: 1

Views: 128

Answers (1)

kjhayes
kjhayes

Reputation: 163

Yes, you can make an installer for your c++ project that should allow your someone on windows to simply install and run it. There are multiple options for doing this but the first way that comes to mind for me is using cmake with cpack, but that would take learning how to use both, which, if you plan on continuing to use c++, is probably worth the effort in the long run.

Short term though, if you want to quickly send your project to your friend in a way he can run it, you can install a cross compiler for windows on your linux machine and just send him a compiled version for windows. Again, there are multiple options but I'm pretty certain MinGW should work for what you need, and be much simpler to learn quickly than cmake with cpack.

Upvotes: 3

Related Questions