0

我有一个 Linux jni 项目(github 上的 Jgles2),我正试图在 Windows 上编译它。

使用 msys2 我使用 pacman 安装了以下软件包 make、gcc、mingw-w64-x86_64-glfw、mingw-w64-x86_64-angleproject-git

我看到很多这样的链接错误(glfw 没有)

 [exec] gcc -shared -o libJgles2.dll jni/util.o jni/gles2.o -L/mingw64/lib/ -lglfw3 -lgdi32 -lGLESv2
 [exec] jni/gles2.o:gles2.c:(.text+0x25): undefined reference to `glBindFramebuffer'
 [exec] jni/gles2.o:gles2.c:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `glBindFramebuffer'

... 之后 ....

  [exec] jni/gles2.o:gles2.c:(.text+0x2425): undefined reference to `glBindBuffer'

我的 makefile 规则看起来像这样

CC=gcc
LIBS= -L/mingw64/lib/ -lglfw3 -lgdi32 -lGLESv2

libJgles2.dll: $(OBJ) jni/Jgles2_util.h jni/Jgles2_util.h jni/Jgles2_GLES2.h
    $(CC) -shared -o $@ $(OBJ) $(LIBS)
4

0 回答 0