Do not use the QT IDE to develop __linux using Windows (VS) Linux (Eclipse)

Source: Internet
Author: User

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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.