سؤال

I am currently making a simple game with SDL in C++. When I compile and run the game in Ubuntu using the command line, the game runs perfectly without problems. However, when I try to compile the same code with Codeblocks in Windows 7, the program crashes after about 12 seconds every time. I have searched for memory related issues using GDB and checked that all asset (images, music, etc) are in the correct directories, but nothing comes up that helps to address the issue. Is there something I am missing about compiling SDL or C++ code in Windows that is not necessary in Linux?

Any help is greatly appreciated.

Here is a link to my code: https://www.dropbox.com/s/gebuas2xc9esq82/src.zip

compile only the main.cpp file using the line: g++ -o main main.cpp -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf

You must have SDL, SDL_image, SDL_mixer and SDL_ttf installed to compile this code.

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

المحلول

Okay after checking Valgrind I noticed the problem was with "smpeg.dll" So I downloaded a fresh version of this DLL and now there is no more crash. Here is a link to the successful version of "smpeg.dll" if anyone needs it.

Link: https://www.dropbox.com/s/heba4dq4kuqx28n/smpeg.dll

Thanks!

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