0

I have searched for dozen of hours already (probably, 10+), but couldn't find a solution to my problem anywhere. I will list all the things I have tried and the issues I have encountered with them.

This is the library that I am trying to build using maven https://github.com/runtimeverification/mpfr-java The included README lists the instructions needed to compile for my platform, such as, simply, mvn install

It seems to me that hawtjni-maven-plugin:1.18 uses for building vcbuild.exe which was included with Visual Studio 2008. Important thing to note is that I am using amd x64 system.

  1. This is the latest (3rd) error I am getting after downloading vcbuild.exe for x64 exclusively and adding it to the system PATH.

Maven output:

[INFO] --- hawtjni-maven-plugin:1.18:generate (default) @ mpfr_java ---
[INFO] Analyzing classes...
[INFO] Generating...
[INFO] Done.
[INFO] 
[INFO] --- hawtjni-maven-plugin:1.18:build (default) @ mpfr_java ---
[INFO] executing: cmd.exe /X /C "vcbuild /platform:x64 vs2008.vcproj release"
[INFO] rc: -1073741515
vcbuild failed with exit code: -1073741515
  1. The first one that I encountered was

    'VCBuild.exe' is not recognized as an internal or external command, operable program or batch file.

Which was obviously because the standard windows builds are now using MSBuild.exe And vcbuild is deprecated.

  1. The second one was something like

    "could not locate vcbuild for x64 system"

When I initially encountered this problem (2) I thought of just downloading the C++ Visual Studio 2008, but when I tried to download it from the Microsoft official website, I was asked if I'd like to save 6MB powerpoint presentation. So this didn't work. So I tried searching online for VS 2008 which had vcbuild included in it. And I found it! So now my system could understand "vcbuild" command. But however I tried, the installation lacked amd64 and "x64" folders, there was only the x32 version. Which led to the (3).

And the final attempt (1) was with the vcbuild.exe I found somewhere online.

So in all aforementioned cases I could not build my project.

Which leaves me with 4 options that I am aware of:

  1. Find the exact copy of VS 2008 with vcbuild for x64.
  2. Somehow manage to find the correct vcbuild.exe for x64 exclusively.
  3. Tweak maven plugin hawtjni to use MSBuild instead of VCBuild (I do not know how to do that)
  4. Follow the instructions in the README regarding "Building a JNI library which statically links against MPFR and GMP" Which I am not sure will not produce the same error because of vcbuild.

What should I do to resolve this problem?

Tim Kochetkov
  • 149
  • 1
  • 11
  • Is using another Platform an option? Looks like Linux is well supported and WSL is nice on Windows. – Thorbjørn Ravn Andersen Sep 16 '22 at 11:43
  • @ThorbjørnRavnAndersen but If I compile for linux would I be able to use it on my windows machine? – Tim Kochetkov Sep 16 '22 at 12:15
  • Another question: since it has something to do with hawtjni, can I tweak this plugin to use MSBuild? Any info on that is scarce – Tim Kochetkov Sep 16 '22 at 12:17
  • Probably not. Use another language supported directly by the library you actually want to use. – Thorbjørn Ravn Andersen Sep 16 '22 at 12:23
  • The original library is in C, but I want to use JavaFX as a Front-End for my program. This is the original library https://mpfr.loria.fr (MPFR). And the one in my post provides a JAVA interface for it. Could you, please, help with a general idea of how you would've done this? – Tim Kochetkov Sep 16 '22 at 18:48
  • 1
    I would ask the maintainers of the Java interface very nicely if they could provide you with a set of files corresponding to the release mentioned in the README file for testing. Or, you could choose to file an issue on the project that the release files mentioned in the README are not live yet. – Thorbjørn Ravn Andersen Sep 16 '22 at 23:08
  • 1
    But the best bet is using a technology designed to work well with the library you want to use. I would consider the “needs a 15 year old unsupported technology just to build on your platform” to be a very, very red flag. – Thorbjørn Ravn Andersen Sep 17 '22 at 10:55
  • They never specified that it would use vcbuild, and there is no reason to, but for some reason they do, and if they chose to use it, then they could have chosen msbuild, which means they probably set it explicitly somewhere in project config or something, and maybe I can set it back to currently relevant build script. Thank you for the answers, yes, indeed, a very red flag. I will try building on Linux, post an issue on GitHub, and probably will create my own Java interface for mpfr. – Tim Kochetkov Sep 17 '22 at 14:23
  • 1
    Very well. Don’t use jni but some of the newer replacement technologies. Enjoy - it will probably be fun – Thorbjørn Ravn Andersen Sep 17 '22 at 14:33
  • Never heard of any new ones, could you suggest any? – Tim Kochetkov Sep 17 '22 at 15:26
  • 1
    Not looked into it. Consider opening a new question. – Thorbjørn Ravn Andersen Sep 18 '22 at 07:56

0 Answers0