Linux:
Eclipse Configuration
Create a new + + + Project
Add a CPP file main.cpp
Write
#include "stdio.h"
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
int main ( int argc, char * argv[])
{
qapplication app (ARGC,ARGV);
Qlabel *label = new Qlabel ("Hello qt!");
Label->show ();
printf ("QT main");
return app.exec ();
}
1 Include directories to add QT
Compile hint Error
Error "must build your code with position independent code if QT is built with-reduce-relocations."
Solution Tick Position indenpendent Code
Compilation error did not add library
Main.cpp:6: Undefined reference to ' qapplication::qapplication (int&, char**, int)
。。。。。。。。。。
Workaround. Add a library file
If you also hint that qtxxx so lacks a dependent library.
libicui18n.so.48, needed by/home/xxxxxxxx/install/qt/lib/libqt5core.so, not found (try Using-rpath or-rpath-link)
and (from libqt5core.so) a dozen errors like:
/home/xxx/install/qt/lib/libqt5core.so:-1:error:undefined reference to Ucnv_fromunicode_48 '
Solve
Windows:
Windows can be passed through the QT addon plug-in. You can also add your own CPP as above Linux and compile the required files through the RCC UIC MOC. and then Build