|Re: Attempting to debug Qt gui app with Eclipse [message #1794249 is a reply to message #1794048]
||Tue, 28 August 2018 05:04
Registered: October 2012
You need to treat it as a third party library.|
There are a number of ways to do this -- too many to enumerate.
There is no 'best' way as 'best' depends on your needs.
In general, you need to change the compiler settings if you are using a managed build.
Alternatives to a managed build (i.e., Eclipse creates the makefile) could be Autotools or writing your own makefile.
With managed builds, you may be able to get away with inserting an execution of pkg-config in your compile command line:
Under Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> <compiler> --> Miscellaneous
Add as other flags `pkg-config --cflags opencv` (Note the back ticks)
replace opencv with the name of your Qt package.
If that can't be done, you'll need to add the proper paths to the Includes settings dialog for the compiler.
You also need to tell the linker what libraries to use.
Again you may be able to set misc. linker flags with `pkg-config --libs opencv`
Otherwise, use Project --> Properties --> C/C++ Build --> Settings --> GCC C++ Linker --> Libraries
And you need to tell the Indexer where the library includes reside (assuming they aren't in /usr/include somewhere).
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entrues --> CDT User Settings Entries
to set the paths to the includes.
It's also possible to alternately use Project --> Properties --> C/C++ General --> Paths and Symbols
Just keep in mind that Eclipse is a text editor with the ability to call external programs such as Make which in turn calls the compiler and linker.
Debugging GUI programs is tricky because they are generally reactive to user inputs and you can only step through small portions of them.
[Updated on: Thu, 30 August 2018 21:38]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01832 seconds