나는 구축하려고 노력한다이 SDL2 샘플 프로그램, 그러나 실패했습니다.
Makefile을 사용하여 수행했습니다.
CFLAGS = -I/usr/include
CC = arm-linux-g++
sdltest: sdl2-test.cpp
$(CC) sdl2-test.cpp -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image $(CFLAGS) `sdl2-config --cflags --libs` -o sdl2-test
clean:
rm sdl2-test
나는 그것을했고 다음과 같은 결과를 얻었습니다.
$ arm-linux-g++ sdl2-test.cpp -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image -I/usr/include `sdl2-config --cflags --libs` -o sdl2-test
In file included from /usr/include/SDL2/SDL_stdinc.h:31:0,
from /usr/include/SDL2/SDL_main.h:25,
from /usr/include/SDL2/SDL.h:32,
from sdl2-test.cpp:2:
/usr/include/SDL2/SDL_config.h:4:35: fatal error: SDL2/_real_SDL_config.h: No such file or directory
#include <SDL2/_real_SDL_config.h>
^
compilation terminated.
make: *** [Makefile:4: sdltest] Error 1
그런 다음 CFLAGS
Makefile을 다음으로 변경했습니다.
CFLAGS = -I/usr/include -I/usr/include/x86_64-linux-gnu
효과가 있었고 이런 응답을 받았습니다.
$ arm-linux-g++ sdl2-test.cpp -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image -I/usr/include -I/usr/include/x86_64-linux-gnu `sdl2-config --cflags --libs` -o sdl2-test
In file included from /usr/include/SDL2/SDL.h:38:0,
from sdl2-test.cpp:2:
/usr/include/SDL2/SDL_cpuinfo.h:102:23: fatal error: immintrin.h: No such file or directory
#include <immintrin.h>
^
compilation terminated.
make: *** [Makefile:4: sdltest] Error 1
immintrin.h
아래에서는 찾을 수 없습니다 /usr/include
.
이와 같은 샘플 프로그램을 구축하려면 어떻게 해야 합니까?
추신: 저는 SDL2를 설치하기 전에 실수로 SDL1을 설치했습니다. 왜냐하면 저는 초보자이고 SDL에 대해 충분히 알지 못하기 때문입니다. 아래는 내 설치입니다.
~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/SDL* -d
drwxr-xr-x 2 root root 4096 三 13 16:37 /usr/include/SDL/
drwxr-xr-x 2 root root 4096 三 13 13:56 /usr/include/SDL2/
~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/x86_64-linux-gnu/ -d
drwxr-xr-x 11 root root 4096 三 13 16:37 /usr/include/x86_64-linux-gnu//
~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/x86_64-linux-gnu/SDL* -d
drwxr-xr-x 2 root root 4096 三 13 10:14 /usr/include/x86_64-linux-gnu/SDL2/