PDA

View Full Version : Integrate Qt to Eclipse Mars 2



Lokl
29th April 2016, 10:20
Hi !

Some threads talk about that but most of them are old. Moreover I know you can put a Qt plugin to eclipse but it doesn't work for me (admin privileges reasons).

So for 3 days I've been trying to set up eclipse builder for making good ouput prebuild like make it invokes qmake. then I set all qt includes and libs in properties>C\C++>Settings. But after all, my compiler gcc can't make it.

Somebody knows how to set up properly eclipse mars 2 for running a Qt project ?

By the way, I'm working on Windows 7 64 on eclipse mars 2. I use Qt5.6 builded with the same mingw than eclipse.

Lokl
20th June 2016, 11:47
In case to up the things up ! Here what I've done :
My conf :
-VM windows 7 x64
-IDE eclipse mars 2 CDT 4.5
-own Build Qt 5.6
-MINGW 4.8.2

For setting up Qt env in eclipse you need to set some custom build
1) Set system variable environment QT_HOME and MINGW_HOME
2) Do not use preferences in eclipse. Could make a mess in your eclipse
3)import a project exemple Qt (Existing Code as Makefile Project)
4)Make external tools
-qmake -project working directory : source code
-qmake : idem
5)go project properties step by step
-add qmake in builder choose import and import qmake external tool. Push it up at first position (very important)
-go C\C++ Toolchain Editor. Current toolchain : MINGW GCC, Current builder GNU MAKE BUILDER (very important)
-go C\C++ Build. unable Use default build command and generate Makefiles automatically. Build command : path to your mingw32-make. build directory : your source directory
-onglet behaviour>build settings unable Stop on first Build error
-C\C++ General>Paths and symbols add includes and libs Qt. Better to add sources location
-apply and ok
6)Build to the "hammer icon"
7)Get all the makefiles debug and release from the builder command qmake
8)Get all your output files moc, ui_*.h, .o from the makefiles rules gcc and other tools Qt
-run one moretime an external tool mingw32-make to obtain the .exe in debug and release.

This is pretty straightforward put you got what you want. Don't hesitate to ask question about.
Cheers Lokl

Current troubleshoot :
-No mingw32-make clean and distclean working properly
-Cant get a shadow build yet