C ++:如何添加外部库 [英] C++: How to add external libraries

查看:268
本文介绍了C ++:如何添加外部库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将SVL添加到我的项目中。

I'm trying to add SVL to my project.

没有它,我得到了数百个错误(未定义的参考...)。添加-lSVL后,所有错误都消失了,但gcc说:找不到-lSVL。其他所有东西(SDL,SDL_TTF,SDL_Mixer ...)都可以正常工作。

Without it I'm getting hundreds of errors (undefined reference...). After adding -lSVL all errors are gone, but gcc says: "cannot find -lSVL". Everything else (SDL, SDL_TTF, SDL_Mixer...) works fine.

推荐答案

您应该通知gcc libsvl的路径。 a,例如:

You should inform gcc of the path where libsvl.a is installed, for example:

gcc -lsvl -L/my/path/

另外,如果您在Linux下工作(SVL不同于svl),请注意这种情况。

Also, pay attention to the case if you work under Linux ("SVL" is different from "svl").

这篇关于C ++:如何添加外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆