electronstudio / jaylib

Java JNI bindings for Raylib
Other
126 stars 23 forks source link

RLGL and raymath #22

Closed electronstudio closed 3 years ago

electronstudio commented 3 years ago

RLGL works on Linux. On Windows, it requires raymath.h as well, and then compilation fails due to unexpected brackets around line 1030. Only way to fix this seems to be to delete the code it doesn't like (I can't understand why it doesn't like code) which may or may not break raymath and/or RLGL.

So risk including broken versions, or dont include them on windows, or dont include them on any platform?

electronstudio commented 3 years ago

The problem on Windows is that the compiler doesn't like the parameter names 'near' and 'far'. I renamed all occurrences of them and now it seems to work. So we have Raymath on all platforms. Leaving this here in case I decide to investigate what on earth is going on.

electronstudio commented 3 years ago
cl "/IC:\Program Files\Java\jdk1.8.0_202\include" "/IC:\Program Files\Java\jdk1.8.0_202\include\win32" C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\jniRaylib.cpp C:\Users\Richard\IdeaProjects\jaylib4\gen\jnijavacpp.cpp // /Oi /O2 /EHsc /Gy /GL /MD /LD /W3 /link /OUT:jniRaylib.dll /LIBPATH:C:\Users\Richard\IdeaProjects\jaylib4 raylib.lib gdi32.lib shell32.lib user32.lib OpenGL32.lib winmm.lib psapi.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30137 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '//'
jniRaylib.cpp
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1246): error C2059: syntax error: ')'
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1248): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1254): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1260): error C2059: syntax error: ')'
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1265): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1265): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1277): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1285): error C2059: syntax error: ')'
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1287): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1288): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1291): error C2059: syntax error: ')'
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1293): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1293): error C2100: illegal indirection
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1305): error C2059: syntax error: ')'
C:\Users\Richard\IdeaProjects\jaylib4\gen\com\raylib\raymath.h(1321): error C2059: syntax error: ')'
electronstudio commented 3 years ago

Looks like it is another case of Raylib and windows.h name conflicts, so https://github.com/electronstudio/jaylib/issues/4

https://stackoverflow.com/questions/118774/is-there-a-clean-way-to-prevent-windows-h-from-creating-a-near-far-macro?noredirect=1&lq=1