Home > Backend Development > C++ > Why Can\'t I Use Pre-built Qt Binaries with Visual Studio 2010?

Why Can\'t I Use Pre-built Qt Binaries with Visual Studio 2010?

Mary-Kate Olsen
Release: 2024-11-25 11:42:18
Original
240 people have browsed it

Why Can't I Use Pre-built Qt Binaries with Visual Studio 2010?

Unable to Utilize Prebuilt Binaries for Qt in Visual Studio 2010

Building Qt from source is necessary when integrating it with Visual Studio 2010 due to compatibility issues with prebuilt binaries designed for Visual Studio 2008.

Building Qt with Visual Studio 2010 Command Prompt

  1. Download the Qt source from Qt's download page.
  2. Extract the sources to a convenient directory.
  3. Open Visual Studio Command Prompt (2010) from the start menu.

Configuring Qt

Configure the Qt build with specific flags for a minimalist installation:

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
Copy after login

Compiling Qt

Start the build process by running:

nmake
Copy after login

Setting Environment Variables

  1. Set the QTDIR environment variable to the Qt installation directory using setx:
setx QTDIR e:\Qt
Copy after login
  1. Add the Qtbin directory to the PATH environment variable using Path Editor or Control Panel.

Installing Qt Visual Studio Add-in

Download and install the Qt-VS-Addin from Qt's download page. Restart the computer for changes to take effect.

Demo Applications

Qt demo applications should now run correctly. Refer to binqtdemo.exe for an example.

Additional Resources

  • Qt 4.8 Installing Qt for Windows: https://wiki.qt.io/Category:Qt_4.8
  • Qt DevNet forums: https://forum.qt.io/

The above is the detailed content of Why Can\'t I Use Pre-built Qt Binaries with Visual Studio 2010?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template