如何修复“在动态链接库中找不到SDL_RWclose的过程入口点”的问题。

5
我想要使用SDL_image扩展将一个png图像绘制到窗口中,但是却报了一个“找不到入口点”的错误。 我正在使用SDL (2.0.9)和SDL_Image (2.0.5)。 我已经将以下二进制文件复制到可执行目录下:
- 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:\dev\SDL2-2.0.9\i686-w64-mingw32\include\SDL2 ^
-IC:\dev\SDL2_image-2.0.5\i686-w64-mingw32\include\SDL2 ^
-LC:\dev\SDL2-2.0.9\i686-w64-mingw32\lib ^
-LC:\dev\SDL2_image-2.0.5\i686-w64-mingw32\lib ^
-lmingw32 ^
-lSDL2main ^
-lSDL2 ^
-lSDL2_image ^
-o test

我使用空白渲染器测试了窗口,一切都没问题。但是当我添加IMG_Load调用时,就出现了错误。


我遇到了与SDL2-devel-2.0.12类似的问题: “无法在动态链接库中找到SDL_RWtell过程入口点”。 但是在SDL2-devel-2.0.10上运行良好。 - nikioa
2个回答

6

5

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接