[Qt-interest] How to debug a plugin which extends my Qt application, is the stdout redirected somewhere?

Andre Somers andre at familiesomers.nl
Mon Oct 11 18:53:07 CEST 2010


  Op 11-10-2010 16:59, Mauro Brenna schreef:
> Hello everybody,
>
> my question concerns how to debug my application using QtCreator.
> I have just developed a plug-in for my QT application under windows
> system (.dll). The main application loads the plug-in in the starting
> phase creating a widget in a tab widget. The plug-in makes some
> computation, calling a C function, using the input given by the main
> application and returns a numeric result.
> The plug-in loads correctly and I see the widget but when I use the
> button to run the C function fails and crashes.
>
> I noticed that I can't debug the plug-in. When I run the plug-in in
> QtCreator in release mode, it opens the main application with the dll
> correctly deployed in the Plugins directory. In debug mode It seems to
> load the plug-in release dll, and if I delete it it does not load the
> plug-in.
> In any case, when I tried even the previous time to debug the plug-ins
> I cannot reach any breakpoint.
> Moreover, it seems that "printf " commands in my C code inside the
> plug-in do not show any output in the application output.
>
> How can I debug the plug-in, at least be able to read the "printf"
> lines? I tried also to redirect the output in the stderr using fprintf
> but I can't see it either.
>
> Thanks in advance for the replies,
You should not need to do much special. You just need to make sure that 
your plugin is compiled in debug mode, and because the compilation mode 
of the app and the library need to match, the application needs to be 
compiled in debug mode too.

André




More information about the Qt-interest-old mailing list