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. MSVC Error but MinGW Work

MSVC Error but MinGW Work

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 431 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.
  • T Offline
    T Offline
    ThibautM
    wrote on last edited by ThibautM
    #1

    Hello everyone,
    I have a problem I'm just a Hello World. Everything is fine if I compile with a Kit MinGW 32, I change for a Kit MSVC2017 x64 and boom

    main.cpp:11: erreur : no matching member function for call to 'resize'
    D:\Programmes\Qt\5.11.2\msvc2017_64\include\QtWidgets\qwidget.h:837: candidate function not viable: no known conversion from 'QPushButton' to 'QWidget' for object argument
    D:\Programmes\Qt\5.11.2\msvc2017_64\include\QtWidgets\qwidget.h:493: candidate function not viable: requires 1 argument, but 2 were provided
    main.cpp:13: erreur : cannot initialize object parameter of type 'QWidget' with an expression of type 'QPushButton'
    

    The msvc compilers were not automatically detected I had to put the path to the hand (probably because I did not install it in the default folder if a path variable can solve the problem I'm interested in).

    D:\Programmes\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe
    

    The main

    #include <QApplication>
    #include <QPushButton>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QPushButton hello("Hello world!");
        hello.resize(200, 60);
        hello.show();
        return app.exec();
    }
    

    The Pro file

    SOURCES      = main.cpp
    QT += widgets
    

    I can't make simpliest sample

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Are you really sure the testcase is exactly what you're trying to compile? Since you don't have 11 lines in your example whereas the error occurs at line 13 ...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      • Login

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