【问题标题】:gcc compiler cant find external librarygcc 编译器找不到外部库
【发布时间】:2014-04-29 05:55:42
【问题描述】:

我有一个关于 Boost 库的问题。我编译了它,我可以在项目中使用该库。现在我做了一个新项目,想把 .我在链接器和 C++ 编译器中添加了库。我正在使用 Eclipse

这是我的编译器输出:

18:45:16 **** Incremental Build of configuration Debug for project Asterretje ****
Info: Internal Builder is used for build
g++ -o Asterretje.exe main.o Vertex.o RouteCalculator.o Reader.o Graph.o Edge.o -llibboost_regex-mgw48-mt-1_55 
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -llibboost_regex-mgw48-mt-1_55
collect2.exe: error: ld returned 1 exit status

18:45:17 Build Finished (took 915ms)

有人知道怎么解决吗?

【问题讨论】:

  • 最后需要.lib吗?

标签: c++ regex eclipse gcc boost


【解决方案1】:

添加开关-L<dir>,其中<dir>是boost库的目录。你应该从库文件名中删除第一个“lib”部分,例如 libmylib.so 你应该传递 -lmylib

【讨论】:

    【解决方案2】:

    感谢大家的帮助

    我发现了问题。我忘了插入搜索路径。

    【讨论】:

      猜你喜欢
      • 2015-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多