SDL2 与 C 未定义引用“IMG_Load”
SDL2 with C undefined reference to `IMG_Load'
我正在使用 SDL2 在 C 中编程,但出现此错误:
`main': main.c:(.text+0x2d0): undefined reference to 'IMG_Load'`
我有这些包括:
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <stdio.h>
作为参考,我正在使用 Arch Linux 并通过以下命令使用 GCC 进行编译:
gcc main.c `sdl2-config --libs -lSDL2 -lSDL2_image` -o game
我到处寻找解决方案,但 none 似乎解决了这个问题。
这个:
gcc main.c `sdl2-config --libs -lSDL2 -lSDL2_image` -o game
应该是:
gcc main.c `sdl2-config --libs` -lSDL2 -lSDL2_image -o game
换句话说,只有sdl2-config --libs
是子命令。
我正在使用 SDL2 在 C 中编程,但出现此错误:
`main': main.c:(.text+0x2d0): undefined reference to 'IMG_Load'`
我有这些包括:
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <stdio.h>
作为参考,我正在使用 Arch Linux 并通过以下命令使用 GCC 进行编译:
gcc main.c `sdl2-config --libs -lSDL2 -lSDL2_image` -o game
我到处寻找解决方案,但 none 似乎解决了这个问题。
这个:
gcc main.c `sdl2-config --libs -lSDL2 -lSDL2_image` -o game
应该是:
gcc main.c `sdl2-config --libs` -lSDL2 -lSDL2_image -o game
换句话说,只有sdl2-config --libs
是子命令。