Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    External errors

    General and Desktop
    2
    2
    971
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Anonymous last edited by

      Code below works with Qt 5.3.2 but when I try to compile it on the 5.4 I get external errors... Also I've noticed many of projects built with Qt 5.3.2 can not be open in 5.4... Always getting error - Could not find qmake configuration file default.
      Error while parsing file C:/Users/Administrator/Documents/phLogin/phLogin.pro. Giving up.

      @#include "Windows.h"
      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      #include <QProcess>
      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      DWORD procId;
      QString pIDClient;
      QString prefix = "cmd /C taskkill /F /S localhost /PID ";
      QString name = "Notepad";
      HWND hwnd = FindWindow(NULL, (LPCTSTR)name.utf16());
      if(hwnd != 0)
      {
      GetWindowThreadProcessId(hwnd, &procId);
      pIDClient = QString::number(procId);
      }

         QProcess *cKill = new QProcess(this);
         QString cIDKill = prefix + pIDClient;
         cKill->start(cIDKill);
      

      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }
      @

      @mainwindow.obj:-1: error: LNK2019: unresolved external symbol __imp__FindWindowW@8 referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z)

      mainwindow.obj:-1: error: LNK2019: unresolved external symbol __imp__GetWindowThreadProcessId@8 referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z)@

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Looks like you've got some linking and qmake problems.

        For a start, I would recommend to do a full clean up of your build, remove .pro.user file, then open and configure the project again using Qt 5.4. I suspect you've got some leftovers from previous builds and they are interfering.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • First post
          Last post