Ubuntu的SDL2_TTF: /usr/bin/ld:找不到-lSDL2_ttf
SDL2_TTF on Ubuntu: /usr/bin/ld: cannot find -lSDL2_ttf
我已经看过几个可能的解决方案,试图解决这个问题,但我仍然有以下问题与SDL_ttf和SDL2绘制文本。
julian@julian-linux:~/Documents/SDL/Font Demo/pt2$ make
g++ texttest.cpp -w -lSDL2 -lSDL2_ttf -LSDL2_image -o texttest
/usr/bin/ld: cannot find -lSDL2_ttf
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'all' failed
make: *** [all] Error 1
我的Makefile如下:
OBJS = texttest.cpp
#CC specifies which compiler we're using
CC = g++
#COMPILER_FLAGS specifies the additional compilation options we're using
# -w suppresses all warnings
COMPILER_FLAGS = -w
#LINKER_FLAGS specifies the libraries we're linking against
LINKER_FLAGS = -lSDL2 -lSDL2_ttf -LSDL2_image
#OBJ_NAME specifies the name of our exectuable
OBJ_NAME = texttest
#This is the target that compiles our executable
all : $(OBJS)
$(CC) $(OBJS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)
提前感谢您的帮助。
我通过运行
解决了这个问题sudo apt-get install libsdl2-ttf-dev
之前我试图用
修复它sudo apt-get install libsdl-ttf2.0-dev
相关文章:
- LD:尝试编译项目时找不到架构x86_64符号
- LD 找不到生成的函数
- OS X: ld: 找不到 -lstdc++ 的库
- 找不到 -llibmysqld Collect2.exe:错误:ld 返回 1 退出状态
- 在OSx:ld上使用CMake构建C++项目:找不到体系结构x86_64的符号
- /usr/bin/ld:找不到本地 libmpifort.so
- C++ XCODE ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -
- 用ar编译的存档,手动编译,ld找不到
- NDK R20 LD:LD:错误:找不到-lpthread
- g++ 编译错误消息:/usr/bin/ld:找不到 -LSSL
- /usr/bin/ld:在CentOS 7中找不到-lclapack
- 为什么“ld:找不到 -lstdc++ 的库”,当我使用 pybind11 为 c++ 库打包我的 python 绑定时
- /usr/bin/ld:在 Redhat 上找不到 /usr/lib64/libasan.so.0.0.0
- ld:找不到文件:/usr/lib/crt1.o
- 安装 gRPC : ld: 警告: 找不到选项 '-L/<path>/grpc/libs/opt/c-ares' 的目录
- /usr/bin/ld找不到标头:未识别的文件格式
- MacOS LD:找不到符号(x86_64)
- ld.so.1:protoc:fatal:libstdc++.so.6:在 Solaris 11 中找不到版本"GLIBCXX_3.4.20"
- 找不到 ld 符号
- 在mac上的x86_64架构中找不到Ld:符号