Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. External errors

External errors

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k Views
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved