简体   繁体   中英

Qt, Qmake and Visual Studio 2013

I'm currenlty working on a portable project. To make it easier to compile on linux and windows, I'd like to use a .pro file which will generate a Makefile on linux and a visual studio project on windows.

But, I'm facing a problem on a very basic example.

Here is my .pro file:

TEMPLATE        = app
TARGET          = client
CONFIG          += debug
SOURCES         += src/main.cpp

My main.cpp only contains an empty main:

int main(void) { return 0; }

Then, I just open my visual studio console, cd in my project folder and run qmake.exe -spec win32-msvc2013 -tp vc .

This generates the expected vcxproj file, that I can open with visual studio.

The program compiles well with visual, but I got a fail during the execution: Qt5Cored.dll missing .

I've verified:

  • In the project properties, Qt lib directory has been added to the libraries directories
  • Qt5Cored.dll exists (and is located in the Qt lib directory)
  • I'm compiling and executing in debug environment

Additionnal information:

  • Qt is well installed
  • When I create a Qt5 project via visual studio, it works well (but this is not what I want).

When I manually import the .pro file using the Qt add-in, the vcxproj generated works well (no error during the execution): what's the difference? why the qmake doesn't work, but manual import does? Have I missed something to make the qmake work?

As someone has said in the comments of my question, the solution is pretty simple: I just needed to add the Qt bin path to the Windows PATH environment variable.

Problem solved :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM