Closed thorstenkampe closed 10 years ago
Correction: compiling does work in Cygwin32 but it gives directly this error on invocation of the gem:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Hi Thorsten
Do you know CYGWIN specific directive ? It can be compiled fine on both Visual C and mingw gcc. And I don't use Cygwin and have no knowledge about Cygwin's compiler. That means, I can't put long long stuff because if I put it on my code, Visual C can't compile it. It's more problematic for me and Visual C users. The only resolution is you may write the code and make pull request that makes:
typedef long long __int64;
Regards.
There are actually two issues:
if defined
from jniwrap.h
would have to extended to match Cygwin64#if defined(__GNUC__) && (defined(__CYGWIN32__) || defined(__MINGW32__))
#if !defined(__int64)
typedef long long __int64;
#endif
#endif
https://cygwin.com/cygwin-ug-net/programming.html#gcc-64
While the Mingw and Microsoft compilers use the LLP64 data model, Cygwin compilers use the LP64 data model, just like Linux. This affects the size of the type long. In the LLP64 model preferred by Microsoft, sizeof(long) is 4. This applies for the related Win32 types like LONG, ULONG, DWORD, etc., too.
But I would be fine using Mingw GCC (instead of Cygwin's gcc) if you have instructions how to do that.
I believe that using Mingw gcc in most popular way is: http://rubyinstaller.org/ It installs and prepares environment for ruby, mingw and some required libraries. And you can install gems naturally. Best regards.
This seems to be the same issue as in issue #7 ("rjb fails to compile on windows"). This is on Cygwin64 with a 64-bit JDK 8. Same error on Cygwin32 with a 32-bit JDK.
Putting
typedef long long __int64;
(fromjniwrap.h
) abovetypedef __int64 jlong;
injni_md.h
fixes the error.Thorsten