-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
在接入nvboard时,链接参数除了-lSDL2 -lSDL2_image,可能还需要加上-lSDL2_ttf。
我在ubuntu 22.04.1上链接项目中生成的库文件nvboard.a时,只添加前两个参数,部分报错如下(libsdl2-dev版本为 2.0.20 ):
/usr/bin/ld: /path/to/nvboard/build/nvboard.a(font.o): in function `init_font(SDL_Renderer*)': // 此行路径打码处理
font.cpp:(.text+0xb9): undefined reference to `TTF_Init'
/usr/bin/ld: font.cpp:(.text+0x223): undefined reference to `TTF_OpenFont'
/usr/bin/ld: font.cpp:(.text+0x274): undefined reference to `TTF_SetFontHinting'
/usr/bin/ld: font.cpp:(.text+0x285): undefined reference to `TTF_SetFontStyle'
/usr/bin/ld: font.cpp:(.text+0x2a5): undefined reference to `TTF_RenderText_Shaded_Wrapped'
/usr/bin/ld: font.cpp:(.text+0x2d1): undefined reference to `TTF_SetFontSize'
/usr/bin/ld: font.cpp:(.text+0x2f9): undefined reference to `TTF_RenderGlyph_Shaded'
...
在加入-lSDL2_ttf选项后即报错消失,链接成功。
可以据此修改一下README.md的相关内容?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels