سؤال

I have made my project in C++ and used SFMl 2.1, I also have loaded images from disk and when I'm trying to run its .exe file its giving error in image loading. For now I'm trying to run its own .exe fie (in Debug or Release folder of project).

i want to make this .exe file for my friends who are not programmers so that my game would run on their PCs as well. If someone know to make .exe so please help!

هل كانت مفيدة؟

المحلول

First, try to put the images beside the exe file.

After that, your friends probably won't have all the development DLL and libs needed for your app to work. You can use depends.exe to know what is needed for your app to start. Put all those file beside your exe and it should work on most PCs.

Bonus tip

Often, when you experience this kind of problem (application crash when starting directly outside the project), the simplest solution, which is language-agnostic, is to make your app write to a new file within your main function and look where it ends up in your project hierarchy after you ran your app directly (outside the IDE/project).

You'll see right there where the relative root of your app is. Most of the time, it's right next to the compiled file, depending on the language you chose.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top