In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "the basic installation and configuration of Qt under the Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Install Qt Creator and basic construction environment (take Ubuntu as an example):
Install the basic system build kit:
The code is as follows:
Sudo apt-get-y install build-essential cmake valgrind
Download the latest version of binary Qt Creator (it is recommended to use the 2.8series Qt Creator built on Qt4, which is better compatible with the Fcitx input method):
Http://mirrors.ustc.edu.cn/qtproject/official_releases/qtcreator/2.8/2.8.1/
No GUI programming, no need to install Qt SDK, there is no qmake and related Qt development libraries, just download the 60m Qt Creator, for example:
The code is as follows:
Qt-creator-linux-x86_64-opensource-2.8.1.run
After downloading, give execution permission, run and choose the installation directory to install, and you can install it in your own home directory.
Default storage location of project configuration ~ / .config/QtProject
You can customize the location of the configuration file by using the parameter-settingspath, such as:
The code is as follows:
/ home/eechen/qtcreator-2.8.1/bin/qtcreator-settingspath / home/eechen/qtcreator-2.8.1
Note: if you are using the Qt Creator 3 series built on Qt5, which integrates the iBus input method plug-in by default, for the Fcitx plug-in, you need to manually install the package fcitx-frontend-qt5, and then copy libfcitxplatforminputcontextplugin.so to the bin/plugins/platforminputcontexts directory of Qt Creator 3, for example: sudo apt-get install fcitx-frontend-qt5
Ln-s / usr/lib/ `arch`-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so / png/dev/qtcreator-3.2.1/bin/plugins/platforminputcontexts/
Restart QtCreator and you can use the Fcitx input method normally.
2. Change the autocomplete shortcut "Ctrl+ space" to "Alt+/" or "Shift+Return" (Return stands for enter)
Tools-options-Environment-Keyboard: keyboard shortcuts enter "Ctrl+ space", click x in the key order to delete the original "Ctrl+ space", enter a new "Alt+/", and confirm to exit.
3. Use make to build, run, and debug the general purpose CumberCraft + project in Qt Creator.
File-New file or project-Import project-Import existing project
The imported project is built with make, and you need to write your own Makefile file before you can build it. It supports automatic completion, debugging and memory analysis.
4. Use cmake in Qt Creator to build, run, and debug the general Cpico project.
File-New file or project-non-Qt project: create a new CMake project
Enter-DCMAKE_BUILD_TYPE=Debug in the parameters of the "execute CMake" step
Only in this way can the program be debugged in Qt Creator, and the value of-DCMAKE_BUILD_TYPE can be set to Debug or Release or RelWithDebInfo.
Cmake can automatically generate Makefile to facilitate building projects with make, but building projects using cmake must also be able to write CMakeLists.txt files.
Qt Creator supports building projects using qmake,make,cmake, but cannot add files directly to the cmake project. Qt Creator's support for CMake needs to be improved.
The temporary solution is to switch to the file manager to add the file, then right-click the project "execute CMake" to make parsing (parsing) effective, and load the file into the project.
5. Qt Creator will automatically identify the gcc, Gmail +, gdb, make, cmake and valgrind installed in the system, or you can make some custom configurations in the menu tools-> options.
Configure the vim external editor:
Tools-> options-> Environment-> external tools-> Editing with vi
Change xterm to konsole or gnome-terminal
Parameter changed to-e vim "% {CurrentDocument:FilePath}"
Configure the terminal:
Tools-> options-> Environment-> Summary
The KDE environment defaults to
The code is as follows:
/ usr/bin/konsole-e
If you want to use gnome-terminal, set it to / usr/bin/gnome-terminal-x
Set to run the program on the terminal:
Project (sidebar)-run-check "run in Terminal"
Solution to the "ptrace operation not permitted" problem when debugging (gdb):
Temporary settings:
The code is as follows:
Sudo sysctl kernel.yama.ptrace_scope=0
Permanent setting: edit / etc/sysctl.d/10-ptrace.conf to kernel.yama.ptrace_scope = 0
The system defaults to 1 for security and prevents user programs (such as gdb here) from accessing data in memory of other processes (such as konsole,gnome-terminal here).
This is the end of the content of "basic installation and configuration of Qt under Linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.