Hi @vbolea, I’ve added vtk-java11 and the natives to my project and when I run my application, I’m only seeing the jni shared libraries, (libvtk*Java.so) in the jar. How do I install the compatible natives(libvtk*.so) for vtk itself? Are those available via maven as well?
Example error:
java.lang.UnsatisfiedLinkError: /workspaces/my-app/target/native-libs/libvtkWebGLExporterJava.so: libvtkWebGLExporter.so: cannot open shared object file: No such file or directory
Running cmake with Ninja generator from the Visual Studio Command Prompt should look like the following image. CMake should automatically find the Visual Studio 2022 compiler.
Then it is necessary to analyse the exact build commands being issued by nmake which are not present in the log you’ve posted. Please, enable a more verbose output:
Good evening Paulo. I set the verbose option in cmake then generated the vs project:
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
The attached is the vs 2022 log. I trust it shall give some leads to the Java problem you
have identified. Looking at the errors generated, yes, it does look like a machinery system
fault with 120 casualties.
Find attached. Thanks very much and good luck.
ngwarai
I asked that because even the verbose mode is not resulting in the exact commands issued during build. So I guess you have to do like suggested by @dgobbi further up (build in a VS command prompt window) to get a more informative build log. We need to get all information of what is being done. Other than that, we can only guess, guess and guess only to go nowhere. That is not very efficient.
The MSVC compiler is actually a program called cl.exe, so after opening the developer command prompt for VS 2022, do some simple checks as shown in the following image to make sure the compiler is in the path. For cmake, you can set the environment variables CC and CXX to the compiler (use the full path). CC is what cmake will use for CMAKE_C_COMPILER and CXX is what cmake will use for CMAKE_CXX_COMPILER. MSVC uses the same compiler for both C and C++.
Good evening Paulo. Thanks very much for your patience. Please find attached the diagnostic build log of vs2022. It is set to maximum verbosity. I had to compress to a zip for attachment.
I found the lines below very concerning (there is one like this for each of the Java wrappings):
511>Project file contains ToolsVersion="17.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="Current". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.
511>Target "EnableIntermediateOutputPathMismatchWarning" skipped, due to false condition; ('$(RestoreProjectStyle)' == 'PackageReference') was evaluated as ('' == 'PackageReference').
511>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets":
511> Set Property: _InvalidConfigurationMessageText=The BaseOutputPath/OutputPath property is not set for project 'vtkChartsCoreJava.vcxproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='Win32'.
511> Set Property: _InvalidConfigurationMessageText=The BaseOutputPath/OutputPath property is not set for project 'vtkChartsCoreJava.vcxproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='Win32'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
Other parts of the log refer to 14.42.34433. It looks like a corrupted or misconfigured VS2022 installation to me - or - you are somehow re-using VS project files (.vcxproj files) configured for another VS.
I’d try:
Make sure you have a clean and healthy VS2022 Community installation. Keep an eye for other VS installed in your system.
Start a new, clean build of VTK from scratch (delete everything in the build directory).