0

我想用来pacman安装OpenGL,但编译时出错。

我想链接,-lglut -lGLU -lGL但那些是什么包?有没有办法找出来?

#include <iostream>
using namespace std;

#include <SDL2\SDL.h>
#include <GL\glu.h>

int main(int arc, char *argv[]) {
    cout << "Hello world" << endl;
    glShadeModel(GL_SMOOTH);
    return 0;
}

我运行(显然我得到一个错误,说如果使用 lib 则找不到-lGLU

g++ *.cpp

这是错误

C:\Users\User\AppData\Local\Temp\ccztMdnY.o:main.cpp:(.text+0x39): undefined reference to `__imp_glShadeModel'
F:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main':
C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
4

0 回答 0