Hello,

I'm new to MITK plugin development.

I would like to run the following code
(part of the code are found at 
https://neurita.github.io/how_to_create_a_python_plugin_for_mitk )
  #include <autoload/PythonService/mitkPythonService.h>
  ...
  itk::SmartPointer<mitk::PythonService> _PythonService(new 
mitk::PythonService());
  std::string result = _PythonService->Execute( "print ('Hello World!')", 
mitk::IPythonService::SINGLE_LINE_COMMAND );

However, this linking error occurs.
It seems the constructor of "PythonService" is not found.
  PythonTest.obj : error LNK2019:
  unresolved external symbol "public: __cdecl 
mitk::PythonService::PythonService(void)" (??0PythonService@mitk@@QEAA@XZ)
  referenced in function "protected: void __cdecl 
PythonTest::DoImageProcessing(void)" (?DoImageProcessing@PythonTest@@IEAAXXZ)

When I remove this code, the build process always works correctly.
I'm building this plugin on MITK v2022.10 using Visual Studio 2019 Community 
and Windows 11 22H2.

"MitkPython", "MitkQtPython" and "Python3|Python" are listed in the 
CMakeLists.txt of a plugin named PythonTest.
  mitk_create_plugin(
    EXPORT_DIRECTIVE PYTHONTEST_EXPORT
    EXPORTED_INCLUDE_SUFFIXES src
    MODULE_DEPENDS MitkQtWidgetsExt MitkPython MitkQtPython
    PACKAGE_DEPENDS Python3|Python
  )

I would be grateful if you could give me some advice on this problem.
Thank you.

Best regards,
Hiro


_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to