Hi Pedro,
the macro
MITK_CORE_EXPORT<http://docs.mitk.org/nightly-qt4/MitkExports_8h.html#a74f1f32242ba56d6e905b9dbc2eeec73>
is only necessary when your class is located in the MITK Core and will be used
by other classes that are not located in the Core.
So, as the linker error disappeared when you removed the macro, I suspect that
your class is not located in the Core but some other module.
This may also be the problem with the crash in LoadStateMachine(). This method
expects the XML definition of the statemachine to be stored in the
MITK resource system. You cannot define any path in the filesystem here. See
http://docs.mitk.org/nightly-qt4/MicroServices_Resources.html for
further details on the resources system.
Calling LoadStateMachine( "statemachine.xml" ); will try to load the XML-file
"statemachine.xml" that is located in the MITK Core!
Your statemachine XML file should (and most likely is) located in the same
module as your interactor. So you will have to call this:
#include <mitkGetModuleContext.h>
#include <mitkModuleContext.h>
...
LoadStateMachine( "statemachine.xml", mitk::GetModuleContext()->GetModule() );
This will load the "statemachine.xml" that is located in the resources of your
current module.
That should solve your crash.
Greets,
Markus
Von: Pedro Cardoso [mailto:[email protected]]
Gesendet: Mittwoch, 24. Juli 2013 23:52
An: [email protected]
Betreff: [mitk-users] Creating a new interactor
I copied the code from the tutorial step 10, but if I maintain this:
MITK_CORE_EXPORT<http://docs.mitk.org/nightly-qt4/MitkExports_8h.html#a74f1f32242ba56d6e905b9dbc2eeec73>
an error occurs, a linkage error. I removed that and it compiles.
But now every time I try to load a state machine with:
exampleInteractor->LoadStateMachine("statemachine.xml") an exception occurs:
Unhandled exception at 0x7517c41f in Project.exe: Microsoft C++ exception:
mitk::Exception at memory location 0x0021c328..
Does anyone got a clue of what's going on? Also I'm not sure of where I should
put the state machine and config files.
I'd also like to know how can I change the PointSetInteractor, I mean, I don't
want to press shift in order to add a point.
Thanks.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users