Hi Caspar,

thank you very much for the nice explanation.

I took your suggestion, I build the example and I will do my tests
directly in the tutorial projects. So I can keep the project template
for a BlueBerry based application only.

Thanks again.

Best,

Yari

Il 03.08.2015 17:31, Goch, Caspar Jonas ha scritto:
> Hi Yari,
>
> I would recommend not using the Apps directory that way. If your concern is 
> only to build the examples and play with them a bit you can do this in the 
> MITK-build [3], just switch on MITK_BUILD_EXAMPLES . Currently you are using 
> a function/framework designed to support BlueBerry based applications to 
> create a non-BlueBerry based one. It can be done, but generally it will 
> require more work/understanding of CMake.
>
> If you want to, you can also copy folder in [3] to your modules directory.
>
> It boils down to:
>
> mitk_create_executable and mitkFunctionCreateBlueBerryApplication do 
> different things and expect different input. The first assumes there is a 
> files.cmake, the second does not.
>
> Best,
> Caspar
>
> [3] 
> http://mitk.org/git/?p=MITK.git;a=tree;f=Examples/Tutorial/Step6;h=ce890898dba58323f31a35d7d4bfc5a6e92caf8b;hb=HEAD
>
> -----Ursprüngliche Nachricht-----
> Von: yari mattei [mailto:[email protected]]
> Gesendet: Montag, 3. August 2015 11:56
> An: [email protected]
> Betreff: Re: [mitk-users] QMetaObject symbol not found
>
> Hi Caspar,
>
> thanks for the answer. What you assumed is almost right. I will explain in 
> detail what is my problem.
>
> I create a MITK project with the project tmeplate and I start develop an 
> application following the tutorial steps.
>
> I put all the code in the "SOURCE/Apps/AwesomeApp/"
>
> (e.g for step1.cpp I have just copy/paste the code in AwesomeApp.cpp and 
> works fine)
>
> Everything is working perfect since step6. What I did for step6 is
>
> 1. download all the files (step6.cpp, step6.h, step6RegionGrowing.txx, 
> step6RegionGrowing1.cpp, step6RegionGrowing2.cpp and step6main.cpp)
>
> 2. copy the code from "step6main.cpp" to "AwesomeApp.cpp"
>
> 3. import all the file (step6.cpp, step6.h, step6RegionGrowing.txx, 
> step6RegionGrowing1.cpp, step6RegionGrowing2.cpp) in my project
> ("SOURCE/Apps/AwesomeApp/")
>
> Now when I try to build I get the "QMetaObject symbol not found" error.
>
> What I have understood so far is that I need to add the "step6.h" file into 
> the list of MOC_H_FILES in files.cmake, but as you said is not present in 
> "SOURCE/Apps/AwesomeApp/".
>
> I tried to put it in different place but I cannot manage to make it create 
> the moc file.
>
> Hope this explanation is clear :)
>
> Thanks a lot for the help
>
> Yari
>
> Il 03.08.2015 11:34, Goch, Caspar Jonas ha scritto:
>> Hi Yari,
>>
>> I assume you are using the project template. I also assume that:
>>
>> The following file does exist
>> YOUSOURCE/Modules/MyAwesomeLib/files.cmake
>>
>> The following file does *not* exist:
>> YOUSOURCE/Apps /AwesomeApp/files.cmake
>>
>> That is as it should be (see [1]).
>>
>> I assume the problem is that your application source file is not build/you 
>> get an error about it missing? The mitkFunctionCreateBlueBerryApplication 
>> defaults to, in this case, AwesomeApp.cpp if no sources are set (see [2]).
>> if(NOT _APP_SOURCES)
>>     set(_APP_SOURCES ${_APP_NAME}.cpp)
>> endif()
>>
>> As a solution you can either rename your .cpp accordingly or set the source 
>> files for the function. If your trouble stems from other files not being 
>> found you might reconsider adding the to the application directory, 
>> generally it should only contain a couple of files by design.
>>
>> I hope this helps, if I misjudged your problem let me know,
>>
>> Best,
>> Caspar
>>
>> [1]
>> http://mitk.org/git/?p=MITK-ProjectTemplate.git;a=tree;f=Apps/AwesomeA
>> pp;h=9706f8a5877b946e3b15882e339486ff37cfd385;hb=HEAD
>> [2]
>> http://mitk.org/git/?p=MITK.git;a=blob;f=CMake/mitkFunctionCreateBlueB
>> erryApplication.cmake;h=d84d10e8b9b4be0339cb6614e33df537ab2ad5ca;hb=HE
>> AD#l40
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: yari mattei [mailto:[email protected]]
>> Gesendet: Freitag, 31. Juli 2015 16:10
>> An: [email protected]
>> Betreff: Re: [mitk-users] QMetaObject symbol not found
>>
>> Hi Sascha,
>>
>> I am having some problem. I am working in the "AwesomeApp" project wchich 
>> does not have the "files.cmake" file I tried to create it (with the 
>> MOC_H_FILES variable) but it doesn't seems to work. I have to add something 
>> else?
>>
>> Thanks
>>
>> Yari
>>
>> Il 28.07.2015 19:04, Sascha Zelzer ha scritto:
>>> Hi Yari,
>>>
>>> did you add the header file (step6.h) to the CMake list of files
>>> which should be processed by moc (look at files.cmake and the
>>> MOC_H_FILES variable)?
>>>
>>> Cheers,
>>> Sascha
>>>
>>> On 07/28/2015 04:47 PM, yari mattei wrote:
>>>> Hi guys,
>>>>
>>>> I am trying to create my own user interface for a MITK based
>>>> application.
>>>>
>>>> I have created a MITK proejct with the project template and I am
>>>> folowing the tutorial steps.
>>>>
>>>> I made the all the steps since the step5 without any problem, but I
>>>> am having problem with step6.
>>>>
>>>> Just copy and paste the code from step6.h and step6.cpp (I only
>>>> named the file different and I change all the name of the class in
>>>> the
>>>> file) I get this error :
>>>>
>>>> 7>     Creating library
>>>> E:/MITK-d2/MITK-b/AwesomeProject-build/bin/Debug/AwesomeApp.lib and
>>>> object
>>>> E:/MITK-d2/MITK-b/AwesomeProject-build/bin/Debug/AwesomeApp.exp
>>>> 7>Eco3DMainUI.obj : error LNK2001: unresolved external symbol "public:
>>>> virtual struct QMetaObject const * __cdecl
>>>> Eco3DMainUI::metaObject(void)const "
>>>> (?metaObject@Eco3DMainUI@@UEBAPEBUQMetaObject@@XZ)
>>>> 7>Eco3DMainUI.obj : error LNK2001: unresolved external symbol "public:
>>>> virtual void * __cdecl Eco3DMainUI::qt_metacast(char const *)"
>>>> (?qt_metacast@Eco3DMainUI@@UEAAPEAXPEBD@Z)
>>>> 7>Eco3DMainUI.obj : error LNK2001: unresolved external symbol "public:
>>>> virtual int __cdecl Eco3DMainUI::qt_metacall(enum
>>>> QMetaObject::Call,int,void * *)"
>>>> (?qt_metacall@Eco3DMainUI@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
>>>> 7>E:\MITK-d2\MITK-b\AwesomeProject-build\bin\Debug\AwesomeApp.exe :
>>>> fatal error LNK1120: 3 unresolved externals
>>>>
>>>> I find out that should be something related with the Qt
>>>> preprocessor, infact without Q_OBJECT macro after the declaration of
>>>> the class (the code is the same as step6.h and step6.cpp ) it build fine.
>>>>
>>>> Does anyone have any idea?
>>>>
>>>> Thanks
>>>>
>>>> Yari
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> ---------
>>>>
>>>> _______________________________________________
>>>> mitk-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>> ----------------------------------------------------------------------
>> -------- _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
> ------------------------------------------------------------------------------
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users




------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to