0

I've written and compiled a program in c++ that does replaces an online calculator for a business. How can I send them this file in a way that will allow them to run the program without downloading a compiler?

I have tried sending the file as a .txt and changing it to a .exe, as well as sharing a google drive.

When I run the program from my own laptop desktop it is successful, but throws the following error message on the recipients laptop:

The code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem.

I assume that this is because they do not have the compiler downloaded (I used VSC to write and compile). Is there any way around them downloading VSC and compiling the code themselves?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 2
    You can either be sure to distribute the DLL with your program (e.g. by sending an installer), or [statically link](https://stackoverflow.com/a/6405064/1424875). To the best of my knowledge, unless you are doing something unusual, statically linking this library *should* resolve your issue. – nanofarad Jan 15 '21 at 21:58
  • 1
    VSC is not a compiler. Your compiler is called MinGW (which is a variant of GCC). – HolyBlackCat Jan 15 '21 at 22:01
  • 2
    Your users don't need to install the whole compiler. Use a tool like [`ntldd`](https://github.com/LRN/ntldd) to determine what dlls (that come with the compiler) are needed, and distribute them in the same folder as your exe. – HolyBlackCat Jan 15 '21 at 22:03

0 Answers0