Vs2013+qt5+vsqtaddin+cmake Work Environment Construction work notes

Source: Internet
Author: User


This article outlines:

This article has documented how to build vs2013+qt5+vsqtaddin+cmake working environment. If you encounter problems in the construction process can not be resolved to contact the author csdn-[email protected]

The article is divided into several parts, 1. Contrast 2. Download and install section 3 configuration 4. CMake + qt 5 notation and example download

Comparison of Cmake+vs and Qtcreator development:

Engineering is basically involved in the business is large and not complex, while the complexity of debugging needs are not high, you can directly use Qtcreator, when the project is relatively large, debugging needs high complexity, need to refer to the third-party library more than a long time, Cmake+vs will be a better choice! And the price of CMake + vs in Exchange is a bit of a hassle.

In general, the following comparisons are:

1. Console (QT development time running, no special handling no console, not the IDE inside that, CMake can choose the WIN32 option, so that you can flexibly use printf to print)
2. Third-party library references (have to say that the VS compiler is still more powerful, I personally experience, Qtcreator MinGW cannot link and vs can)
3. Network resources (VS network resources can not be compared, do not say)
4. The development of non-pure general business applications (the author is doing streaming media and visual development, there are many other libraries in the development process need to compile and reference, such as FFmpeg, live555, boost, etc., so since the powerful cmake to make your reference process more smooth and comfortable! )



Start!


Download resources:


Download links for Qt5:

http://mirrors.hust.edu.cn/qtproject/development_releases/qt/5.4/5.4.0-beta/


After the installation is ready, it will appear as follows: QT5 and VA plug-in display



Then will they all kinds of installation, the details do not say, after installing into VS, you need to set up a version of QT, as follows:

When setting the QT path, select the path of the Qt5.4, and the upper directory of the bin, showing








After the project is created, if an index error occurs, deleting the SDF file, such as, will reopen the project.




Direct import of QT Pro Project can be compiled, but the error will be as follows: Fatal error LNK1117: syntax errors in option "Subsystem:[email Protected][email protected]"

Workaround: Remove "/subsystem:windows%40qmake_subsystem_suffix%40" from the other options, command line, linker, project properties



Use CMake to generate project files for Qt 5! (Need to add qmake environment variables before cmake)


Its core code is as follows: CMake use the following reference: http://blog.csdn.net/gubenpeiyuan/article/details/44085747

These two days csdn upload a bit of a problem, always can not pass this CMake QT5 project example, are open source code do Helloword, there is no copyright problem, need friends to contact me.

Include (${project_source_dir}/rule.cmake) ##################################################################### # Add QT5 library ###################################################################### Find includes in corresponding build Directoriesset (Cmake_include_current_dir on) # Instruct CMAKE to run MOC automatically when Needed.set (Cmake_automoc on) # Find the Qtwidgets libraryfind_package (qt5core) find_package (qt5widgets) find_package (Qt5quick) ADD_DEFINITIONS (${QT _definitions}) # (3) Convert. h file to MOC operation, UI file for UIC operation, resource file for RCC operation message (STATUS "Directory" ${cmake_current_source_dir}) # Set (Cendvc_headers ${cmake_current_source_dir}/cendvc.h) set (Cendvc_qrcs ${CMAKE_CURRENT_SOURCE_DIR}/CENDVC.QRC) Set (Cendvc_srcs ${cmake_current_source_dir}/main.cpp ${cendvc_qrcs}) set (Cendvc_rc_file ${cmake_current_source_dir }/cendvc.rc) #QT5_WRAP_CPP (Cendvc_headers_moc ${cendvc_headers}) qt5_add_resources (CENDVC_QRC_RCC ${CENDVC_QRC S}) # (4) Add project and connect QT Library set (Qt_use_qtmain TRUE) #WIN32ADD_EXECUTABLE (${ouputexEC} ${cendvc_srcs} ${cendvc_headers_moc} ${CENDVC_QRC_RCC} ${cendvc_rc_fi LE}) Set (Executable_output_path ${project_source_dir}/bin) ###################################################### ############################################################################## #target_link_libraries (${ Ouputexec} ${project_sysfun_name}) # Use the Widgets module from Qt 5.target_link_libraries (${ouputexec} qt5::widgets Qt5 :: Core Qt5::quick)


























Vs2013+qt5+vsqtaddin+cmake Work Environment Construction work notes

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.