0

I have a Linux jni project (Jgles2 on github) which I'm trying to compile on windows.

With msys2 I have used pacman to install the following packages make, gcc, mingw-w64-x86_64-glfw, mingw-w64-x86_64-angleproject-git

I see lots of link error (none with glfw) like this

 [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'

... later ....

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

my makefile rule looks like this

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)
Chris Camacho
  • 1,164
  • 1
  • 9
  • 31
  • Hi Chris, your project seems to require ant and java to be built at present. Unfortunately MSYS2 doesn't have OpenJDK yet. Can you supply GNU Makefiles in the meantime, then I will investigate this for you. Thanks in advance. – Ray Donnelly Dec 30 '15 at 11:16
  • msys2 can (and does in this project) use the windows jdk (and windows version of ant) - please see inside the jni library, this makefile is designed to be executed by the ant build script. I have managed to link to the dll's and the application runs but angle won't return a shader ID (glCreateShader returns 0) and I see only a blank screen – Chris Camacho Dec 31 '15 at 15:20
  • I'm sure it can. I try to avoid installing software built outside of MSYS2 (other than Windows itself), particularly stuff by Oracle (do they still try to install the Ask Toolbar? urgh). If it's Open Source software the best course of action is to add a package to MSYS2 instead (like OpenJDK). Anyway, it sounds like you got past the link error you were asking about, so that's great. For your glCreateShader issue, I'm guessing your context wasn't created properly for whatever reason. You need to build angleproject in debug mode. If you want help then ask me on IRC, #msys2 channel on OFTC. – Ray Donnelly Jan 01 '16 at 16:07

0 Answers0