Hi,

it still sounds like an issue for the loader to find all necessary DLLs, in 
particular since the call to LoadLibrary() fails. For example, it could be that 
the dependencies of MitkDICOMImageIO​.dll cannot be found because they may not 
be within the search path or something similar.


See the installer I referenced in my last mail. Since DLLs are distributed in 
different folders, we use batch scripts for starting our applications. These 
batch scripts just assemble the PATH variable before starting the actual 
applications.


On Windows, Dependency Walker [1] can be a valuable tool to track down such 
issues.


As a side note we cannot provide good support for Qt Creator as it is - at 
least on Windows - not within any of our platform support tiers. In the past we 
repeatedly had major issues with Qt Creator as it regularly broke even between 
minor updates in particular regarding CMake projects. So from our perspective 
we cannot recommend Qt Creator as a stable development environment. That may 
have changed since Qt itself transitioned to CMake but we burnt our hands 
enough to be very careful with future Qt Creator experiments. :-)


Best,

Stefan


[1] https://www.dependencywalker.com/

________________________________
Von: VR Bay <bayvr...@gmail.com>
Gesendet: Montag, 27. Juni 2022 16:17
An: Dinkelacker, Stefan
Cc: mitk-users@lists.sourceforge.net
Betreff: Re: [mitk-users] Dicom-loading fails in tutorial project

Hi Stefan,

I think we are getting closer but it still does not work: I placed the dll (and 
several correct others) in the subfolder you mentioned but I got these warnings 
(per dll):

0.24 core.mod.core.act WARNING: In `anonymous-namespace'::load_impl at 
C:\MITK\Modules\CppMicroServices\core\src\util\usUtils.cpp:90 : The selected 
module cannot be found.
0.24 core.mod.core.act WARNING: In us::AutoLoadModulesFromPath at 
C:\MITK\Modules\CppMicroServices\core\src\util\usUtils.cpp:176 : Auto-loading 
of module C:\DLLTEST\MitkCore\MitkDICOMImageIO.dll failed.

So it founds the modules/dlls in the directory but somehow it cannot load them. 
UnfortunateIy, I cannot determine the problem by debugging it because the 
LoadLibrary fails in line 87, in usUtils.cpp, and I cannot step into this 
macro. Any ideas?

I don't think I need the project template as I don't want to build my own 
modules/plugins only I only want to integrate the existing ones into my 
project. Or do I misunderstood the conception? It can't be used to build the 
Step1 example if I understand correctly.

(Also, I followed the invalid postprocessing token and the problem is with the 
DEPRECATED macro in mitkImageVtkAccessor.h. Now I think it's just some parsing 
error which has no effect, totally unrelated to my problem, by the way I use Qt 
Creator.)

Thank you for your response!

Best regards,
Peter

Dinkelacker, Stefan 
<s.dinkelac...@dkfz-heidelberg.de<mailto:s.dinkelac...@dkfz-heidelberg.de>> ezt 
írta (időpont: 2022. jún. 27., H, 6:17):

Hi Peter,


my first guess would be that your process of copying the DLLs next to the 
executable is the source of the issue. MitkDICOMImageIO is an auto-load module 
(using the CppMicroServices) and these auto-load modules are expected NOT to be 
next to the executable but instead in a subfolder named after the module they 
are supposed to be loaded with.


In most cases like in MitkDICOMImageIO MitkCore is specified as AUTOLOAD_WITH 
target (see Modules/DICOM/autoload/DICOMImageIO/CMakeLists.txt). To better 
understand the directory structure, I suggest to download and extract the 
official MITK .zip file [1] and look into the bin folder. There you find for 
example an MitkCore folder which contains the MitkDICOMImageIO module and other 
auto-load IO modules.


When working with Visual Studio in the build tree, the locations differ 
compared to the installer like there are intermediate Debug/Release folders but 
all of this is usually nothing to worry about as long as you use the MITK CMake 
macros and functions for creating modules and plugins.


Please consider to start with the MITK Project Template for hopefully less 
frictions [2].


Regarding your warning about an invalid preprocessing token I can just assume 
that you maybe accidentally modified/pasted something? I searched for ")static" 
in the whole MITK repository but could not find anything and I also never saw 
such a warning. :-)


Best,

Stefan


[1] 
https://www.mitk.org/download/releases/MITK-2022.04/Windows/MITK-v2022.04-windows-x86_64.zip

[2] https://github.com/MITK/MITK-ProjectTemplate



________________________________
Von: VR Bay <bayvr...@gmail.com<mailto:bayvr...@gmail.com>>
Gesendet: Freitag, 24. Juni 2022 18:18
An: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Betreff: [mitk-users] Dicom-loading fails in tutorial project

Hello Everyone,

I'm a first time user of MITK. I've succesfully built the v2022.04 version and 
I'm able to create my own cmake project with it which compiles and runs.

After building manually the step1 tutorial example, when I try to load the 
sample .nrrd image a window appears and shows the image but when I try to load 
the sample dicom (.dcm) image the mitk::IOUtil::Load() throws an 
mitk::Exception which says: "core.mod.core.ioUtil ERROR: No reader available 
for %filename%.dcm." so no image is showed.

When I run the Step1 application which was built during the mitk build process 
(in ../superbuild/Mitk-build/bin/Debug/MitkStep1.exe) it runs perfectly: it 
shows the dicom image.

So the app sources are the same but they were built differently so I think the 
problem is with my cmake configuration.

I also debugged the app and I concluded that the problem is that no dicom 
reader is registered in the usServiceRegistry.

The problem is that I don't know how to register the correct service in my app. 
I tried to link the app with multiple DICOM modules (like MitkDICOMImageIO) 
without success. I tried changing module load order still without success. This 
CppMicroServices concept is not clear for me yet (just like Cmake).

Additional notes:
- I link the libraries dinamically with target_link_libraries in my 
cmakelists.txt (and copy the proper dll-s next to the executable)
- when including "mitkIOUtil.h" there's a warning: "In included file: pasting 
formed ')static', an invalid preprocessing token"

So this my problem that I cannot solve for days now and I have run out of 
ideas. I would appreciate if anyone could help me solve this problem.

Best regards,
Peter
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to