【问题标题】:Link glew.lib as a static library with eclipse将 glew.lib 作为静态库与 eclipse 链接
【发布时间】:2017-09-17 01:43:49
【问题描述】:

我是 C++ 的新手,在我问之前我做了很多搜索,我开始使用 C++ 开始 OpenGL 教程,我正在使用带有 GNU 交叉编译器的 eclipse,我知道如何喜欢 libXXX.a 格式的静态库然后我想使用GLEW 库,我有它的源代码和Windows 的预编译版本libglew32.lib,如果我使用make 编译源代码,我会收到一个错误,即

make (e=2): The system cannot find the file specified. Makefile:131: recipe for target 'tmp/cygwin/default/shared/glew.o' failed make: *** [tmp/cygwin/default/shared/glew.o] Error 2.

如果我将库放在库文件夹中并将其添加到链接器中,就像处理其他库一样,我会在编译项目时遇到错误,例如 undefined reference to 'glewExperimental'Invalid arguments 'Candidates are:void glfwMakeContextCurrent(*)'

所以我有 2 个问题:

  1. 如何将源代码正确编译成可以在 eclipse 中使用的静态库。
  2. 我可以添加.lib 文件以与eclipse 一起使用吗?如果是,我该怎么做?

【问题讨论】:

  • 我使用 gcc 编译它并用 ar 衬里最后我得到了 libglew.a

标签: c++ eclipse opengl glew


【解决方案1】:

我使用gcc 编译它并用ar 排列,最后我得到libglew.a

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-23
    • 1970-01-01
    • 2013-09-03
    • 1970-01-01
    • 2014-01-06
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    相关资源
    最近更新 更多