1

I made an Allegro game in Visual Studio. It's very small.

But how can I get a finished .exe? When I copy the .exe out of the project's debug folder and try to run it, it basically says "Sorry the Allegro dll's are all missing! Install them and try again," since I've removed it from its resources.

How can I bundle it together so that everything it needs is packed into the .exe?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220

2 Answers2

2

Why?

  1. If you want to deliver the application in one file:

    • Either create an .msi setup project within Visual Studio (or using a third party tool),

    • Or simply compress the files (executable and DLLs) into an archive. Most archive applications like WinZip or WinRar also let you to create a single executable which will extract itself without requiring the end user to download an additional application.

  2. If you want for some weird reason have everything in one executable, then you may:

    • Move the source code into the same Visual Studio project. But you really shouldn't, since it is against code reuse and it will cause additional problems related to code organization,

    • If you use .NET, create a custom solution which will contain the assemblies inside (for example in the resources) and extract them when started. This is possible in .NET since you need to have the assemblies only when you need them, which means that the application which uses a library in some cases doesn't need this assembly in order to start.

Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
2

What you are asking to do is called "static linking." The advantages and disadvantages of this are listed here. For some compilers, Allegro.cc documents how to enable static linking on this page.

Brian
  • 25,523
  • 18
  • 82
  • 173