Nvidia Jetson开发系列(一) SDL_TTF框架移植

背景

英伟达平台搞osd时间戳,参考原海思,稍微麻烦了一点!
osd背景参考《海思OSD开发系列(一) SDL_TTF框架移植》

超快编译

我已经将所有资源整理上传到github/gitee

使用编译完成的库直接测试

所有编译好的库和文件都放在lib下面。

//git clone https://github.com/hayson/jetson_sdl_ttf.git
git clone https://gitee.com/hayson/jetson_sdl_ttf.git
cd jetson_sdl_ttf/sample
make;./run_test.sh

打开save.bmp即生成的osd位图。

重新编译

cd jetson_sdl_ttf/
./build.sh

编译过程记录

如果只是使用的话这里不用看了,记录遇到了问题,给别的平台移植参考。

SDL-1.2.15配置失败

主要原因是SDL-1.2.15版本比较老,config.guess里面没有支持当前arm版本这种build类型

  • 出错记录1
checking build system type... ./build-scripts/config.guess: unable to guess system type

This script, last modified 2009-09-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (./build-scripts/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to  in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-09-18

uname -m = aarch64
uname -r = 5.10.104-tegra
uname -s = Linux
uname -v = #8 SMP PREEMPT Wed Nov 9 05:59:23 UTC 2022

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.10.104-tegra
UNAME_SYSTEM  = Linux
UNAME_VERSION = #8 SMP PREEMPT Wed Nov 9 05:59:23 UTC 2022
configure: error: cannot guess build type; you must specify one
  • 解决办法1
    下载最新github上sdl2的版本(SDL2-2.26.4.tar.gz),从里面拷贝最新的config.guess和config.sub替换即可。
    ps:出错提示下载的config.guess不行。
  • 错误记录2
./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for ‘_XData32’
  168 | SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)

一个type冲突,修改SDL_x11sym.h文件
替换168行
SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)

参考

freetype-SDL-SDL_TTL
《Jetson Xavier Nx安装SDL1.2.15》

你可能感兴趣的:(Nvidia,Jetson,开发系列,sdl,osd,sdl_ttf,jetson,位图)