________________________________________ Von: Madda [[email protected]] Gesendet: Mittwoch, 30. Oktober 2013 18:26 An: Goch, Caspar Jonas Cc: [email protected] Betreff: Re: [mitk-users] Linking problems
Hi Caspar, you understood perfectly. I tried to use the MITK plugin gererator, executing the example line: $ ./MITKPluginGenerator --plugin-symbolic-name prova.myplugin --view-name "MyView" --project-name "MyProject" It generates the folder with the CMakeList.txt. $ ccmake . -- runs withour errors but when I run make it gives this error $make -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) CMake Error at MITK-superbuild/CTK-src/CMake/ctkMacroSetupPlugins.cmake:144 (message): The following plug-ins are using invalid symbolic names: prova.myplugin Call Stack (most recent call first): CMakeLists.txt:345 (ctkMacroSetupPlugins) Any ideas? Thanks a lot! On 30 October 2013 11:46, Goch, Caspar Jonas <[email protected]<mailto:[email protected]>> wrote: Hi Madda, I want to make sure I understand your setup: 1. You have build MITK from source using the MIT superbuild mechanism and default settings (No externally build toolkits but Qt) 2. You want to create your own project using MITK (and by extension ITK) as a toolkit 3. You have created your own project by hand (as in, wrote all the CMake files yourself) If this is your setup and you are experiencing problems regarding include paths you might want to consider using the MITK Plugin Generator to create a project for yourself [1]. This will automatically setup a working directory for you with the appropriate CMake files. If you are trying to modify an existing project to use MITK this will be more work, but even in that case taking a look at the generated files might help you adapt your own. Did I understand your problem correctly? Best, Caspar [1] http://docs.mitk.org/nightly-qt4/HowToNewProject.html Von: Madda [mailto:[email protected]<mailto:[email protected]>] Gesendet: Mittwoch, 30. Oktober 2013 11:53 An: [email protected]<mailto:[email protected]> Betreff: [mitk-users] Linking problems Hello, I am new to MITK. I successfully installed them and now I am trying to compile a very simple cxx file. I am also using the ITK libraries and since I had the ITK4 already installed for other projects I am linking to the ITK version installed by MITK. This is .cxx file (the ITK parts are excluded): //--------------------------------------- #include "mitkPicFileReader.h" static const unsigned int ImageDimension = 3; typedef mitk::PicFileReader PicReaderType; int main( int argc, char ** argv ) { PicReaderType::Pointer r = PicReaderType::New(); char* name; r->SetFileName(name);//a_inputFileName()); r->Update(); return EXIT_SUCCESS; } //---------------------------------------- This is my CMakeList.txt: #--------------------------------------------------------------------------------------------- # include itk SET(ITK_DIR /home/strumia/Programs/MITK/MITK-superbuild/ITK-build/) FIND_PACKAGE(ITK) IF(ITK_FOUND) MESSAGE ('ITK_USE_FILE' ${ITK_USE_FILE} ) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) # include mitk SET (MITK_DIR /home/strumia/Programs/MITK/MITK-superbuild/MITK-build) FIND_PACKAGE(MITK REQUIRED) IF(MITK_FOUND) INCLUDE_DIRECTORIES(${MITK_INCLUDE_DIRS}) ELSE(MITK_FOUND) MESSAGE(FATAL_ERROR "MITK not found. Please set MITK_DIR.") ENDIF(MITK_FOUND) LINK_DIRECTORIES(${MITK_LINK_DIRECTORIES}) ADD_EXECUTABLE(PicReadWrite PicReadWrite.cxx) TARGET_LINK_LIBRARIES(PicReadWrite ${ITK_LIBRARIES} ${MITK_LIBRARIES}) #--------------------------------------------------------------------------------------------- I have two problems: 1. If I do cmake . with this CMakeList.txt it will not find the mitk .cpp files; for example it gives me this error In file included from /home/strumia/Desktop/prova_link_MITK/PicReadWrite.cxx:3:0: /home/strumia/Programs/MITK/MITK-2012.09.0-src/Modules/IpPicSupport/mitkPicFileReader.h:26:32: fatal error: mitkLegacyAdaptors.h: No such file or directory 2. To solve this I add to include manually all the directories. The CmakeList.txt becomes: #--------------------------------------------------------------------------------------------- # include itk SET(ITK_DIR /home/strumia/Programs/MITK/MITK-superbuild/ITK-build/) FIND_PACKAGE(ITK) IF(ITK_FOUND) MESSAGE ('ITK_USE_FILE' ${ITK_USE_FILE} ) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) # include mitk SET (MITK_DIR /home/strumia/Programs/MITK/MITK-superbuild/MITK-build) FIND_PACKAGE(MITK REQUIRED) IF(MITK_FOUND) INCLUDE_DIRECTORIES(${MITK_INCLUDE_DIRS}) ELSE(MITK_FOUND) MESSAGE(FATAL_ERROR "MITK not found. Please set MITK_DIR.") ENDIF(MITK_FOUND) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Modules/IpPicSupport) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Modules/LegacyAdaptors) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-superbuild/MITK-build/modulesConf) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-superbuild/MITK-build) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/IO) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Common;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/DataManagement;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Algorithms;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Rendering;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Interactions;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Controllers;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Core/Code/Service) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Utilities/tinyxml;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Utilities/mbilog;/home/strumia/Programs/MITK/MITK-superbuild/MITK-build/Utilities/mbilog) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-2012.09.0-src/Utilities/ipPic;/home/strumia/Programs/MITK/MITK-2012.09.0-src/Utilities) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Code/Common;/home/strumia/Programs/MITK/MITK-superbuild/ITK-build;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/vcl) INCLUDE_DIRECTORIES(/home/strumia/Programs/MITK/MITK-superbuild/ITK-build/Utilities/vxl/vcl;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/core/vnl;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/core;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/vcl/config.win32/vc60;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/vcl/config.win32;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/vcl/config.win32/vc70;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/vcl/config.stlport.win32-vc60;/home/strumia/Programs/MITK/MITK-superbuild/ITK-src/Utilities/vxl/core) LINK_DIRECTORIES(${MITK_LINK_DIRECTORIES}) ADD_EXECUTABLE(PicReadWrite PicReadWrite.cxx) TARGET_LINK_LIBRARIES(PicReadWrite ${ITK_LIBRARIES} ${MITK_LIBRARIES}) #--------------------------------------------------------------------------------------------- In this case is able to find the mitk .cpp files, but is giving linking problems: $make Linking CXX executable PicReadWrite CMakeFiles/PicReadWrite.dir/PicReadWrite.cxx.o: In function `mitk::PicFileReader::New()': PicReadWrite.cxx:(.text._ZN4mitk13PicFileReader3NewEv[mitk::PicFileReader::New()]+0x42): undefined reference to `mitk::PicFileReader::PicFileReader()' CMakeFiles/PicReadWrite.dir/PicReadWrite.cxx.o: In function `itk::ObjectFactory<mitk::PicFileReader>::Create()': PicReadWrite.cxx:(.text._ZN3itk13ObjectFactoryIN4mitk13PicFileReaderEE6CreateEv[itk::ObjectFactory<mitk::PicFileReader>::Create()]+0xe): undefined reference to `typeinfo for mitk::PicFileReader' PicReadWrite.cxx:(.text._ZN3itk13ObjectFactoryIN4mitk13PicFileReaderEE6CreateEv[itk::ObjectFactory<mitk::PicFileReader>::Create()]+0x47): undefined reference to `typeinfo for mitk::PicFileReader' collect2: ld returned 1 exit status make[2]: *** [PicReadWrite] Error 1 make[1]: *** [CMakeFiles/PicReadWrite.dir/all] Error 2 make: *** [all] Error 2 Can you please help me? Thanks, -- -Madda- -- -Madda- -- -Madda- ------------------------------------------------------------------------------ Android is increasing in popularity, but the open development platform that developers love is also attractive to malware creators. Download this white paper to learn more about secure code signing practices that can help keep Android apps secure. http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
