Frequently Asked Questions at execution time
Why does my action do not apply to my custom component
When creating a new action you will certainly configure a custom
component to apply your action on. Each CamiTK action works on a
specified type of component. In the constructor of your custom action
MyAction
you will have to explicitly specify which component it works
on, using setComponent()
method, such as described in the example
below:
MyAction::MyAction(ActionExtension * extension) : Action(extension) {
// Setting name, description and input component
setName("My Action name");
setDescription("The action my component does");
setComponent("MyComponentClassName");
}
MyComponentClassName
should remain the exact class name of your custom
component.
Each time a new component of type MyComponentClassName
would be
instantiated in your program, all compatible actions would be
automatically available in the action menu.
In fact, if you look at the code of the apply()
method of your custom
action :
void MyCustomAction::apply() {
foreach (Component *comp, targetComponents) {
MyCustomComponent * input = dynamic_cast<MyCustomComponent *> ( comp );
if(input)
apply(input);
}
}
The targetComponents
member contains all the compatible components for
this specified action.
Why does nothing appear in the camitk-imp
console
When running camitk-imp the console is redirected as another output (log). If you wish to have the standard output using the system console when running IMP, simply add the flag –no-console when running your application. For instance, on Visual Studio, right click on your project.
- select properties
- go to configuration properties > Debugging
- select the 2nd field command Arguments
- add the –no-console argument
Now the camitk-imp console is redirected to your standard console.
In Visual Studio you have 2 different configuration for Debug and Release launch of your application. Be sure to edit the ones you are working on.
FYI : the first field Command refers to the command line launched when you run and instance of your project debugging. You can edit this line to run IMP for instance if you develop a custom extension for it.
Why am I getting the following error: The application was unable to start correctly (0xc000007b)
when I try to run my application
This error likely comes from trying to run a 32 bit windows application on a 64 bit environment. The most effective solution is to download dependency walker and check if your application is calling any 64 bit dll libraries. If so, then replace these libraries with the corresponding 32 bit versions. See a detailed explanation.
An example of when this can occur is when you use libxml2
in your
application. libxml2
depends on the zlib1.dll
library which may already
exist on your computer in the 64-bit version for another unrelated
program (such as intel wifi, corel windvd, matlab, etc.). Your program
may be linking to this dll, causing the above error message. The
solution is to download the 32-bit zlib archive and to place the
zlib1.dll in your libxml\bin directory, the zlib1.h file in
your libxml\include directory and the zlib.lib file in your
libxml\lib directory.
Other case : If it crashes when you run debug version only, it may comes
from a bad ucrtbased.dll
version. Try to copy ucrtbased.dll
x64 version
from Windows Kits\\10\\bin\\ucrtbased.dll
to system32 to replace the bad
one. Or do what its better with file moving for get it working (ie add
this file to your path prior the old one for example).
It does not wok
Try this (often referred to as “a clean build”):
- clean your build
- run CMake
- build your project
- run camitk-imp from your build directory
Cannot find my new Cpp file in my IDE
Rerun CMake to reconfigure your project
“Could not connect slot to signal”
Add Q_OBJECT
just after the declaration of your class and re-run CMake
During the link edition on Windows Cannot find ... implementation
Add an API file (dll_spec import, etc.) in order to be able to reus your Components or Actions Extensions. An then of course, do a clean build.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.