In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the handling of common errors in QT". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the handling of common mistakes in QT"?
On the handling of some compilation errors
If an error message is generated during compilation, it needs to be resolved before the compilation can continue. The error message is mainly caused by the compiler version. There are the following types of error messages:
1 missing tool error
This is the first problem encountered during compilation. When compiling qt2, you need to use the uic tool. Uic is a tool that runs on PC.
It is used to convert the interface files of Qt, that is, .ui files into .h files and .cpp files, which can be handed in only after the conversion is completed.
Compile for cross compilers.
Solution: copy the uic text in qtopia-free-2.2.0/dqt/bin to
Just go under the qtopia-free-2.2.0/qt2/bin.
Note: after uic is copied to qtopia-free-2.2.0/qt2/bin, you need to modify the build script file because
If you re-execute the build command, the script will delete the qtopia-free-2.2.0 folder you just compiled and re-
Extract it, form a new qtopia-free-2.2.0, and start compiling, so that the uic you just copied is meaningless.
The modification method is shown in the following figure:
The custom-linux-arm-g++.h/cpp file was required for the source code, but could not be found.
Solution:
# cd. / qtopia-free-2.2.0/qtopia/src/libraries/qtopia
# cp custom-linux-ipaq-g++.h custom-linux-arm-g++.h
# cp custom-linux-ipaq-g++.cpp custom-linux-arm-g++.cpp
Continue compiling
# cd / root/yizhi
#. / build
4 cannot match the constructor of the QSizePolicy class
That is, the QSizePolicy class does not provide a constructor for specific parameters
Find it in. / qtopia-free-2.2.0/qtopia/src/libraries/qtopia/.ui/release-shared.
Record the following and execute the following command to modify the file:
# gedit. / qtopia-free-2.2.0/qtopia/src/libraries/qtopia/.ui/release-shared/pas
Swordbase_p.cpp
Move the cursor to line 35, as shown in the following illustration:
Save exit and recompile by executing the following command:
#. / build
After recompiling, there will be several errors of this type, and the solutions are very similar, so I won't cover them all here.
The member function of class 5 is preceded by an additional class name
As shown below:
The modified figure is as follows:
For the solution, refer to the following figure:
F=::open (tempFile,latin1 (), 0_CREAT | 0_WRONLY); modified to
F=::open (tempFile,latin1 (), 0_CREAT | 0666); that is, add 0666 parameters.
Save, exit.
For the open function, the third parameter is used to specify access to the file only when a new file is created.
Bit
Note: there are two such modifications, and the other one:
Line 143 location of qtopia-free-2.2.0\ qt2\ src\ tools\ qmemoryfile_unix.cpp file, modify
The square method is similar to the qmemoryfile_unix.cpp file.
#. / build recompile
7 missing this pointer
As shown below:
The solution is as follows:
# gedit.\ qtopia-free-2.2.0\ qt2\ src\ kernel\ qpixmapcache.cpp
Modify behavior 125
The reason for the modification is that some macros are defined in the asm/page.h file, and we have redefined here that we must use the
So you don't need the asm/page.h file here.
Note: more than several types of errors will occur after continuing to compile, and the types of errors are summarized above.
(you can find a solution to the error information through google.) you can modify the method according to the above steps, mainly to find which one.
File error, find the file, use gedit to open the file, move to the error line, modify, save exit. Make a mistake
The file and line number are found according to the error message at compile time, be sure to look for the first Erro, here
It needs to be paid attention to. Through the modification of these error types, you will have a new understanding of Qt migration and improve your
The ability to migrate software.
After the compilation completes successfully, Qtopia2.2.0 is automatically installed to qtopia-free-2.2.0/qtopia/zImage/opt
Below, as shown in the following figure
Note: there is no font on the bottom of the compiled Qtopia, so you need to put it on your own.
Under Qtopia/lib/fonts, there are all kinds of words you can use under the qtopia-free-2.2.0/qt2/lib/fonts folder.
Body, but we only need the helvetica type, which supports Chinese. Execute the following command:
# cp/root/yizhi/qtopia-free-2.2.0/qt2/lib/fonts/Helvetica* / root/yizhi/qtopia-fr
Ee-2.2.0/qtopia/image/opt/Qtopia/lib/fonts/
In addition, you need to copy all the documents under / root/yizhi/armlib to
/ root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib/ under
After copying the font file and the library file, copy the entire Qtopia record to the / opt record of the file system, as shown in
If there is already a Qtopia folder provided for electronics under this directory, you can send the Qtopia files provided for electronic files
Remove the folder to run your own compiled version.
Thank you for your reading, the above is the content of "what are the handling of common errors in QT". After the study of this article, I believe you have a deeper understanding of the handling of common errors in QT, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.