SDL C++链接器错误
我正在尝试在我的计算机上启动并运行 ttf SDL 字体。
我正在使用 CodeBlocks 并已拥有适当的链接来构建标准 SDL 窗口: -lSDL -lSDL_main 没有任何问题。
我已从维基百科和其他来源阅读内容,只是为了确认我应该与 -lSDL_ttf 链接,并且我将其包含在 -lSDLmain 和 -lSDL 之后的 IDE 链接选项中,并收到错误:
ld.exe||cannot find -lSDL_ttf|
||=== Build finished: 1 errors, 0 warnings ===|
我已提取了附带的标头和文件将其下载到编译器中的 SDL 子目录中,但我不明白我做错了什么。
I'm trying to get the ttf SDL fonts up and running on my machine.
I'm using CodeBlocks and have the appropriate linking already to build a standard SDL window:
-lSDL -lSDL_main without any problems.
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:
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请提供有关此处发生情况的更多详细信息。您说 -lSDL 有效但 -lSDL_ttf 无效?这意味着您的编译器正在查找 SDL 库,但找不到 SDL_ttf。您确定某个地方有 SDL_ttf 库(dll)吗?尝试从这里获取它 http://www.libsdl.org/projects/SDL_ttf/
编辑: 你用的是哪个编译器?您是否尝试指定“-L”。这样它就会在当前目录中搜索?您能给我们您正在执行的完整链接器命令吗?
Please give some more detail on what is going on here. You say that -lSDL is working but not -lSDL_ttf? That means that you're compiler is finding the SDL library but not the SDL_ttf. Are you sure you have the SDL_ttf library somewhere (dll)? Try getting it from here http://www.libsdl.org/projects/SDL_ttf/
EDIT: Which compiler are you using? Did you try specifying "-L." so that it will search in the current directory? Can you give us the full linker command you are executing?