简体   繁体   English

从Visual Studio将SDL2游戏导出到Windows

[英]Exporting SDL2 Game into Windows from visual studio

i have created a fully working game using C++ / SDL2 , SDL2_image , SDL2_ttf and SDL2_mixer , the whole game is written in visual studio and now my goal is to export it from the IDE , so i can bassicaly play it anywhere , without using the IDE and compiling it , but i know that all files like SDL2.dll and SDL2_image.dll or how is it called are needed to be in the debug folder to compile it in the IDE properly , how can i just move the file game.exe to my usb and play it properly , is it true that all i need is compiled .exe from IDE and SDL .dlls and audio/images ? 我已经使用C ++ / SDL2,SDL2_image,SDL2_ttf和SDL2_mixer创建了一个可以正常工作的游戏,整个游戏都是在Visual Studio中编写的,现在我的目标是从IDE导出它,因此我可以在不使用IDE的情况下在任何地方玩它并进行编译,但是我知道需要将所有文件(如SDL2.dll和SDL2_image.dll或如何调用)都放在debug文件夹中,以便在IDE中正确地对其进行编译,我如何才能将game.exe文件移至我的USB并正确播放,难道我所需要的就是从IDE和SDL .dll和音频/图像编译的.exe吗? can someone explain it to me ? 有人可以向我解释吗? because i guess if the game is already done it is stupid to keep it in the IDE... thanks 因为我想如果游戏已经完成,将其保留在IDE中是愚蠢的...谢谢

SDL is a shared library, so you'll have to include the SDL2.dll and any other dynamic libraries with your release executable, unless you choose to statically link them into a standalone executable. SDL是共享库,因此,除非您选择将它们静态链接到独立的可执行文件中,否则您必须在发布可执行文件中包含SDL2.dll和任何其他动态库。 You can set all these options (as well as selecting the active build profile to "Release" vs "Debug") in your build options. 您可以在构建选项中设置所有这些选项(以及将活动的构建配置文件选择为“发布”还是“调试”)。 To select the active build profile, click the "Build > Configuration Manager" menu option. 要选择活动的构建配置文件,请单击“构建>配置管理器”菜单选项。 To edit the build profiles, simply go to your project settings and select the active Configuration from the top left dropdown menu in the project settings dialog. 编辑构建配置文件,只需转到项目设置,然后从项目设置对话框的左上方下拉菜单中选择活动的Configuration。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM