如何修复'The procedure entry point SDL_RWclose could not be located in the dynamic link library'

How to fix 'The procedure entry point SDL_RWclose could not be located in the dynamic link library'

本文关键字:located be not in link library could dynamic the procedure The      更新时间:2023-10-16

我正在尝试使用sdl_image扩展名将png映像绘制到窗口,但它给了我一个"未找到"错误

我正在使用sdl(2.0.9(和sdl_image(2.0.5(我将以下bin文件复制到可执行文件

  • libjpeg-9.dll
  • libpng16-16.dll
  • libtiff-5.dll
  • libwebp-7.dll
  • sdl2.dll
  • sdl2_image.dll
  • zlib1.dll

main.cpp提取

#include <iostream>
#include <SDL.h>
#include <SDL_image.h>
int main( int argc, char* args[] )
{
    SDL_Texture* test_tex;
    SDL_Window* window = NULL;
    SDL_Renderer* renderer;
            if(renderer)
            {
                //Tested blank screen and it works
                /*
                SDL_RenderPresent(renderer);
                SDL_Delay(2000);
                */
                //Trying to use SDL_image and it fails
                SDL_Surface *tmp_surface = IMG_Load("player.png");
                test_tex = SDL_CreateTextureFromSurface(renderer,tmp_surface);
                SDL_FreeSurface(tmp_surface);
                SDL_RenderPresent(renderer);
                SDL_Delay(2000);
            }
...

像这样

g++ test.cpp ^
-IC:devSDL2-2.0.9i686-w64-mingw32includeSDL2 ^
-IC:devSDL2_image-2.0.5i686-w64-mingw32includeSDL2 ^
-LC:devSDL2-2.0.9i686-w64-mingw32lib ^
-LC:devSDL2_image-2.0.5i686-w64-mingw32lib ^
-lmingw32 ^
-lSDL2main ^
-lSDL2 ^
-lSDL2_image ^
-o test

我已经用空白渲染器测试了窗口,这一切都可以,当我将调用添加到img_load

时,它会失败

您需要另一个sdl_image版本。使用sdl_image(2.0.4(而不是(2.0.5(。

您可以在此处获得较旧的版本:

https://www.libsdl.org/projects/sdl_image/release/?c=m;o=d

(解决我的问题(

2.0.9 32位sdl2.dll给了我问题,除了VC 以外的任何事物。幸运的是,2.0.10版本可用于测试,实际上适用于我的Code :: Blocks编译测试:https://www.libsdl.org/tmp/tmp/download-2.0.php

相关文章: