0

I just want to send some trivial SDL apps that I made to my non-coder friends. I googled a bit but all I get is more confusion. I genuinely don't know what I should do and where to start.

Some said I would need to use Make/Cmake kind of stuff, some said use some sort of installer like NSIS or INNO Setup, some said I just need to put all the libraries in the folder that I would send to end user.

I tried the last one on a fresh Windows VM, It asked for weird dlls that I don't know what they are ( libstdc++-6 & libgcc_s_seh-1 ). I installed them and put the folder anyway but then it kept asking for more.

I don't know what I should do. Do I need to use another program like CMake or NSIS? ( I am building project on Eclipse as C++ Managed Built ). If not, what kind of build options that I should use? Which libraries that I should add in the file? All I want is a starting point and a guide that I can follow.

Libraries that I use in the app:

stdio.h
math.h
time.h
string
SDL.h ( SDL2 )
SDL_image.h

( And yes, I provided SDL dlls in the file and managed to get a blank window app running on VM. But actaul app does not work. )

Any information regarding to the title is appreciated. Thanks beforehand.

aulven
  • 521
  • 3
  • 14
  • If you're coding this on windows, and your friends also use windows, statically linking all the libraries you use should then allow you to just send them the exe (or a password-protected zip containing the exe, depending on your e-mail client ;) – melk Apr 03 '20 at 16:56
  • `It asked for weird dlls that I don't know what they are [...] I installed them and put the folder anyway but then it kept asking for more` you need to add the dlls of all libraries you dynamically link against and that are not shipped with windows itself into the folder or you need to link them statically. `And yes, I provided SDL dlls in the file and managed to get a blank window app running on VM. But actaul app does not work.` that could indicate a problem with the wrong working directory you load your resources from. – t.niese Apr 03 '20 at 16:56
  • I am going to search statically linking libraries now, I am not sure what actually it is, thanks. Do I need to consider this for standart libraries as well? Like stdio.h etc? – aulven Apr 03 '20 at 17:03
  • Standard libraries (technically the C and C++ runtime libraries) can also be statically linked. – john Apr 03 '20 at 17:05
  • @melonduofromage Static linking means that the libraries become a part of your program (which will increase the size of your exe), vs dynamically linking, which will cause your exe to use the libraries already present on the system (dll stands for Dynamically Linked Libraries). – melk Apr 03 '20 at 17:10
  • I see. Thank you, and thank you everyone. – aulven Apr 03 '20 at 18:03

1 Answers1

1

Some said I would need to use Make/Cmake kind of stuff

Those wouldn't change anything. The build systems just give you a convenient way to invoke the compiler.

some sort of installer like NSIS or INNO Setup

You can use those, but it's not fundamentally different from sending your friends an .exe + .dlls in an archive.

I tried the last one on a fresh Windows VM, It asked for weird dlls that I don't know what they are ( libstdc++-6 & libgcc_s_seh-1 )

You seem to use MinGW. Those .dlls are shipped with your compiler, and are in the same directory as g++.exe.

They should be copied to the folder where your .exe is.

it kept asking for more

It should only ask for some of the .dlls shipped with the compiler, or for .dlls of the libraries you use (SDL2.dll).


As mentioned in the comments, an alternative to copying the .dlls is static linking, i.e. embedding libraries directly into the .exe.

HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207