简体   繁体   English

SDL C ++链接器错误

[英]SDL C++ Linker Error

I'm trying to get the ttf SDL fonts up and running on my machine. 我正在尝试让ttf SDL字体在我的机器上运行。

I'm using CodeBlocks and have the appropriate linking already to build a standard SDL window: -lSDL -lSDL_main without any problems. 我正在使用CodeBlocks,并且已经具有适当的链接来构建标准的SDL窗口:-lSDL -lSDL_main没有任何问题。

I have read from wikipedia and other sources just to confirm I am supposed to link with -lSDL_ttf and I included this in my IDE linking options after -lSDLmain and -lSDL and get the error: 我已从Wikipedia和其他来源阅读,只是为了确认我应该与-lSDL_ttf链接,并且在-lSDLmain和-lSDL之后的IDE链接选项中包含了此链接并得到了错误:

ld.exe||cannot find -lSDL_ttf|
||=== Build finished: 1 errors, 0 warnings ===|

I have extracted the headers and files that come with the download for it to my SDL subdirectory in my compiler and I don't understand what I am doing wrong. 我已经将下载随附的头文件和文件解压缩到了编译器中的SDL子目录,但我不明白我在做什么错。

Please give some more detail on what is going on here. 请提供更多有关此处发生的情况的详细信息。 You say that -lSDL is working but not -lSDL_ttf? 您说-lSDL在工作,但不是-lSDL_ttf? That means that you're compiler is finding the SDL library but not the SDL_ttf. 这意味着您正在编译的是SDL库,而不是SDL_ttf。 Are you sure you have the SDL_ttf library somewhere (dll)? 您确定在某处(dll)有SDL_ttf库吗? Try getting it from here http://www.libsdl.org/projects/SDL_ttf/ 尝试从这里获取它http://www.libsdl.org/projects/SDL_ttf/

EDIT: Which compiler are you using? 编辑:您正在使用哪个编译器? Did you try specifying "-L." 您是否尝试指定“ -L”。 so that it will search in the current directory? 这样它将在当前目录中搜索? Can you give us the full linker command you are executing? 您能给我们您正在执行的完整链接程序命令吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM