jni-bind compatible with Visual Studio 2019 - 16.11.40? #384
-
I am trying to setup the environment on a Windows 10 machine, using Visual Studio 2019 with compilation flags: I am including jni_bind_release.h and get a bunch of compilation errors: Any idea on what I am doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
I'm afraid not, and, this might sound ridiculous but I actually really struggle to get a Windows environment up and running. I don't work with VSCode so it's an extra lift for me to get it running. You're not doing anything wrong, it's likely a compiler incompatability. That said, these types of compatibility issues when bringing up a new compiler are common. If you could provide me a Godbolt sample I can look at, preferably with as little code as possible, I'd be happy to take a look. If you/we can make it work, I'd love to fold this into JNI Bind and add an MSVC compilation test. That said, my time is somewhat more limited and I need some help if folks want this. This issue was tracked, but I unfortunately gave up due to lack of time/resources: |
Beta Was this translation helpful? Give feedback.
-
Ah, hmmn, actually the first part of the bug stands out:
I think this might be the same as #198. Basically, jint is a different type on Windows I think. If so I think I can probably fix it but it would help to have a way to repro this, which I'm not 100% sure how to do. |
Beta Was this translation helpful? Give feedback.
-
I think this is what he did: "If I take a big hammer and make the typedef to a C int on Windows, all is well with jni-bind. // 'long' is always 32 bit on windows so this matches what jdk expects Obviously that isn't suitable for JNI Bind. I think what actually needs to happen is just a simple change in the proxy system but I need a mechanism to exercise it which I could never duplicate. If you're able to create a pull request I can exercise it if you just propose it. We can work on merging pull requests later if we manage to get there, it's actually never come up before as all submissions have originated from Google (and mostly from me). I think if you try the author's "big hammer" you should be able to at least try JNI Bind (beyond the Godbolt sample). To truly fix it, I think you need to modify here. I think there also needs to be an Your simplest bet is to build with Bazel (modifying the monolith header will be hard). I can give it a quick try if that doesn't work but it's hard given I can't validate the failure. I guess an alternative way you could help would be to make a PR to add a Windows test runner so I can see failure. |
Beta Was this translation helpful? Give feedback.
-
Curious if you made any progress? Let me know if I can provide support. |
Beta Was this translation helpful? Give feedback.
I'm afraid not, and, this might sound ridiculous but I actually really struggle to get a Windows environment up and running. I don't work with VSCode so it's an extra lift for me to get it running. You're not doing anything wrong, it's likely a compiler incompatability.
That said, these types of compatibility issues when bringing up a new compiler are common. If you could provide me a Godbolt sample I can look at, preferably with as little code as possible, I'd be happy to take a look.
If you/we can make it work, I'd love to fold this into JNI Bind and add an MSVC compilation test. That said, my time is somewhat more limited and I need some help if folks want this.
This issue was tracked,…