Hi, I am trying to compile the VolView plugin by following the steps in the ./INSTALL
file, but the resulting DLL is not working.
Detailed Steps I Followed:
- Cloned the source code to my local machine at
C:\Users\bm\source\repos\Volview\orthanc-volview
using this command:
hg clone https://orthanc.uclouvain.be/hg/orthanc-volview/
- Created a build directory.
- Ran the CMake command:
cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON C:\Users\bm\source\repos\Volview\orthanc-volview
Log Output:
C:\Users\bm\source\repos\Volview\orthanc-volview\Build>cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON C:\Users\bm\source\repos\Volview\orthanc-volview
CMake Deprecation Warning at CMakeLists.txt:22 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.29.30148.0
-- The CXX compiler identification is MSVC 19.29.30148.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Forking the Orthanc source repository using Mercurial
destination directory: orthanc
requesting all changes
adding changesets
adding manifests
adding file changes
added 5764 changesets with 29053 changes to 2563 files (+14 heads)
new changesets 3959d33612cc:1b0e67be3c15
updating to branch default
857 files updated, 0 files merged, 0 files removed, 0 files unresolved
Setting branch of the Orthanc repository to: default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
CMake Warning (dev) at Build/orthanc/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake:46 (include):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:82 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: C:/Users/bm/AppData/Local/Programs/Python/Python312/python.exe (found version "3.12.2")
MSVC compiler version = 1929
Using local copy of https://orthanc.uclouvain.be/downloads/third-party-downloads/zlib-1.3.1.tar.gz
Uncompressing zlib-1.3.1.tar.gz
Using local copy of https://orthanc.uclouvain.be/downloads/third-party-downloads/jsoncpp-1.9.5.tar.gz
Uncompressing jsoncpp-1.9.5.tar.gz
CMake Warning (dev) at Build/orthanc/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake:103 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
Build/orthanc/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake:499 (include)
CMakeLists.txt:82 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
Using local copy of https://orthanc.uclouvain.be/downloads/third-party-downloads/boost_1_85_0_bcpdigest-1.12.4.tar.gz
Uncompressing boost_1_85_0_bcpdigest-1.12.4.tar.gz
patching file `boost_1_85_0/libs/locale/src/boost/locale/shared/date_time.cpp'
patching file `boost_1_85_0/libs/locale/src/boost/locale/shared/generator.cpp'
patching file `boost_1_85_0/libs/locale/src/boost/locale/shared/localization_backend.cpp'
boost::locale is disabled
Setting the version of the library to mainline
-- Configuring done (32.8s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
OPENSSL_NO_CAPIENG
-- Build files have been written to: C:/Users/bm/source/repos/Volview/orthanc-volview/Build
I then opened Visual Studio 2019 and built the solution. The log showed:
Build started...
1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>1>Checking Build System
2>------ Build started: Project: AutogeneratedTarget, Configuration: Release x64 ------
2>Generating AUTOGENERATED/EmbeddedResources.h, AUTOGENERATED/EmbeddedResources.cpp
2>Generating AUTOGENERATED/StaticAssets.cpp
2>Building Custom Rule C:/Users/bm/source/repos/Volview/orthanc-volview/CMakeLists.txt
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8064: Custom build for item "C:\Users\bm\source\repos\Volview\orthanc-volview\Build\CMakeFiles\f0ac1d8cbb21fb50c6c5e986564c72a9\StaticAssets.cpp.rule" succeeded, but specified dependency "c:\users\bm\source\repos\volview\orthanc-volview\volview\dist" does not exist. This may cause incremental build to work incorrectly.
2>Done building project "AutogeneratedTarget.vcxproj".
3>------ Build started: Project: OrthancVolView, Configuration: Release x64 ------
3>Building Custom Rule C:/Users/bm/source/repos/Volview/orthanc-volview/CMakeLists.txt
3>Plugin.cpp
3>EmbeddedResources.cpp
3>StaticAssets.cpp
3>OrthancPluginCppWrapper.cpp
3>error_code.cpp
3>tss_dll.cpp
3>thread.cpp
3>tss_pe.cpp
3>posix_api.cpp
3>regex.cpp
3>regex_debug.cpp
3>static_mutex.cpp
3>wide_posix_api.cpp
3>greg_month.cpp
3>codecvt_error_category.cpp
3>directory.cpp
3>exception.cpp
3>operations.cpp
3>path.cpp
3>path_traits.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>portability.cpp
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Sources\Plugin.cpp(79,1): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Sources\Plugin.cpp(88,1): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>unique_path.cpp
3>windows_file_codecvt.cpp
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(318,115): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(322,103): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(374,114): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(378,102): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(603,89): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(635,86): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(656,85): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(1212,103): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(1226,104): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(1240,81): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(1411,116): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Resources\Orthanc\Plugins\OrthancPluginCppWrapper.cpp(1418,98): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
3>file_descriptor.cpp
3>json_reader.cpp
3>json_value.cpp
3>json_writer.cpp
3>base64.cpp
3>MemoryCache.cpp
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\orthanc\OrthancFramework\Resources\ThirdParty\base64\base64.cpp(104,61): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\orthanc\OrthancFramework\Resources\ThirdParty\base64\base64.cpp(121,59): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data
3>MemoryObjectCache.cpp
3>ChunkedBuffer.cpp
3>DicomTag.cpp
3>DicomPath.cpp
3>Enumerations.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>FileInfo.cpp
3>MemoryStorageArea.cpp
3>CStringMatcher.cpp
3>HttpContentNegociation.cpp
3>HttpToolbox.cpp
3>MultipartStreamReader.cpp
3>StringMatcher.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Logging.cpp
3>MallocMemoryBuffer.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>OrthancException.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>OrthancFramework.cpp
3>RestApiHierarchy.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\orthanc\OrthancFramework\Sources\HttpServer\HttpContentNegociation.cpp(64,43): warning C4099: 'Orthanc::HttpContentNegociation::Reference': type name first seen using 'struct' now seen using 'class'
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\orthanc\OrthancFramework\Sources\HttpServer\HttpContentNegociation.h(78): message : see declaration of 'Orthanc::HttpContentNegociation::Reference'
3>RestApiPath.cpp
3>SerializationToolbox.cpp
3>StringMemoryBuffer.cpp
3>Toolbox.cpp
3>WebServiceParameters.cpp
3>DeflateBaseCompressor.cpp
3>GzipCompressor.cpp
3>IBufferCompressor.cpp
3>ZipReader.cpp
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\orthanc\OrthancFramework\Sources\SerializationToolbox.cpp(191,30): warning C4101: 'ex': unreferenced local variable
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>ZlibCompressor.cpp
3>HierarchicalZipWriter.cpp
3>ZipWriter.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>StorageAccessor.cpp
3>StorageCache.cpp
3>MemoryStringCache.cpp
3>SharedArchive.cpp
3>FileBuffer.cpp
3>FilesystemStorage.cpp
3>MetricsRegistry.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>RunnableWorkersPool.cpp
3>Semaphore.cpp
3>SharedMessageQueue.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>SharedLibrary.cpp
3>SystemToolbox.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>TemporaryFile.cpp
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
3>adler32.c
3>compress.c
3>crc32.c
3>deflate.c
3>infback.c
3>inffast.c
3>inflate.c
3>inftrees.c
3>trees.c
3>uncompr.c
3>zutil.c
3>gzlib.c
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzlib.c(235,9): warning C4996: 'open': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _open. See online help for details.
3>gzclose.c
3>gzread.c
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzread.c(22,15): warning C4996: 'read': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _read. See online help for details.
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzread.c(599,11): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _close. See online help for details.
3>gzwrite.c
3>md5.c
3>ioapi.c
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzwrite.c(78,20): warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _write. See online help for details.
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzwrite.c(108,24): warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _write. See online help for details.
3>C:\Users\bm\source\repos\Volview\orthanc-volview\Build\zlib-1.3.1\gzwrite.c(627,9): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _close. See online help for details.
3>unzip.c
3>zip.c
3> Creating library C:/Users/bm/source/repos/Volview/orthanc-volview/Build/Release/OrthancVolView.lib and object C:/Users/bm/source/repos/Volview/orthanc-volview/Build/Release/OrthancVolView.exp
3>OrthancVolView.vcxproj -> C:\Users\bm\source\repos\Volview\orthanc-volview\Build\Release\OrthancVolView.dll
3>Done building project "OrthancVolView.vcxproj".
4>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
4>Building Custom Rule C:/Users/bm/source/repos/Volview/orthanc-volview/CMakeLists.txt
5>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
5>Project not selected to build for this solution configuration
========== Build: 4 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========
- I noticed that the resulting
OrthancVolView.dll
file is only 651 KB, whereas the original plugin DLL was 22,747 KB. - I replaced the original plugin DLL with the new one, restarted the Orthanc server, and tried to open a study with the VolView viewer. However, I received the following message in the browser:
{
"HttpError": "Not Found",
"HttpStatus": 404,
"Message": "Accessing an inexistent item",
"Method": "GET",
"OrthancError": "Accessing an inexistent item",
"OrthancStatus": 7,
"Uri": "/volview/index.html"
}
- Additionally, I saw this error in the Orthanc log:
I0907 10:58:19.120936 HTTP-2 HttpServer.cpp:1263] (http) GET /volview/index.html
I0907 10:58:19.121945 HTTP-2 OrthancPlugins.cpp:2478] (plugins) Delegating HTTP request to plugin for URI: /volview/index.html
E0907 10:58:19.121945 HTTP-2 PluginsManager.cpp:154] Accessing an inexistent item: Unknown VolView resource: index.html
E0907 10:58:19.121945 HTTP-2 PluginsErrorDictionary.cpp:101] Exception inside the plugin engine: Accessing an inexistent item
Can anyone help me figure out why the resulting DLL isn’t working? Any suggestions would be appreciated. Thanks!