【问题标题】:Where is freeglut.a in cygwin?cygwin中的freeglut.a在哪里?
【发布时间】:2023-04-04 13:31:01
【问题描述】:

我正在尝试使用 cygwin 的 gcc 在 VSCode 中实现一个小的 OpenGL 渲染器,使用 freeglut 作为窗口系统,但我无法链接到 freeglut。我不知道这个库叫什么,根据what I found on the web,我应该可以链接到-lfreeglut,但这给了我以下信息:

/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld:找不到-lfreeglut collect2: error: ld 返回 1 个退出状态

我在我的 cygwin 文件夹中搜索“glut”并找到了很多东西,但没有库。有趣的是,标题出现了。顺便说一句,我用 cygwin 的包安装程序安装了 freeglut 包(mingw64-x86_64-freeglut v 2.8.1-1)。另外,我对 GNU 系统完全没有经验,所以答案可能很简单。

【问题讨论】:

    标签: c cygwin gnu freeglut


    【解决方案1】:

    我认为从来不是-lfreeglut,而是-lglut

    尝试用普通的 GLUT 库包编译

    libglut-devel: OpenGL Utility Toolkit library
    

    它包括共享库

    usr/lib/libglut.dll.a
    

    两个标题

    usr/include/GL/freeglut.h
    usr/include/GL/freeglut_ext.h
    usr/include/GL/freeglut_std.h
    usr/include/GL/freeglut_ucall.h
    usr/include/GL/glut.h
    

    一般来说,您可以使用 cygcheck 来查找所需的包。

    $ cygcheck -p libglut.dll.a
    Found 5 matches for libglut.dll.a
    libglut-devel-2.8.1-1 - libglut-devel: OpenGL Utility Toolkit librar
    y (installed binaries and support files)
    libglut-devel-3.0.0-1 - libglut-devel: OpenGL Utility Toolkit librar
    y
    libglut-devel-3.2.1-1 - libglut-devel: OpenGL Utility Toolkit librar
    y
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-14
      • 1970-01-01
      • 1970-01-01
      • 2014-08-27
      • 1970-01-01
      相关资源
      最近更新 更多