Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Can't use open source on VS Code
QtWS25 Last Chance

Can't use open source on VS Code

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 4 Posters 1.7k 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.
  • I Offline
    I Offline
    Inderlard
    wrote on last edited by
    #1

    Hi, thanks for reading me.

    I'm trying to use the open source version of Qt on VS Code for a C++ program, but when i try to import the libraries it warning about the libraries can't been found.
    When I revised the Path, i noticed than the "C:\Qt\bin", does'nt exist, but another paths like "C:\Qt\5.15.2\bin" neither exist, and "C:\Qt\5.15.2\msvc2019_64\bin" does'nt work.

    Can somebody tell me how can i use the libraries for make a GUI with Qt open source from VS Code?

    Thanks.

    jsulmJ 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • I Inderlard

      Hi, thanks for reading me.

      I'm trying to use the open source version of Qt on VS Code for a C++ program, but when i try to import the libraries it warning about the libraries can't been found.
      When I revised the Path, i noticed than the "C:\Qt\bin", does'nt exist, but another paths like "C:\Qt\5.15.2\bin" neither exist, and "C:\Qt\5.15.2\msvc2019_64\bin" does'nt work.

      Can somebody tell me how can i use the libraries for make a GUI with Qt open source from VS Code?

      Thanks.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Inderlard said in Can't use open source on VS Code:

      "C:\Qt\5.15.2\msvc2019_64\bin" does'nt work

      What exactly does not work?
      Do you use CMake or QMake?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Inderlard said in Can't use open source on VS Code:

        "C:\Qt\5.15.2\msvc2019_64\bin" does'nt work

        What exactly does not work?
        Do you use CMake or QMake?

        I Offline
        I Offline
        Inderlard
        wrote on last edited by
        #3

        @jsulm Sorry, maybe i had to add more documentation about the problem:
        I new in Qt, and i'm trying to run this program on VSCode:

        #include <iostream>
        #include <QtWidgets/QtWidgets.h>
        #include <QtWidgets/QApplication>
        #include <QtWidgets/QLabel>
        #include <QtWidgets/QPushButton>
        #include <QtWidgets/QVBoxLayout>
        #include <QtWidgets/QWidget>
        
        int main(int argc, char *argv[])
        {
            QApplication app(argc, argv);
        
            QWidget window;
            window.setWindowTitle("Hello World!");
        
            QVBoxLayout layout;
            layout.addWidget(new QLabel("Hello World!"));
            layout.addWidget(new QPushButton("Click Me!"));
            window.setLayout(&layout);
        
            window.show();
        
            return app.exec();
        }
        

        Is a program made with blackbox in VS to learn, i don't know if it is right.
        VSCode give me this error:

        fatal error: QtWidgets/QtWidgets.h: No such file or directory
        

        And the same with the other libraries. I put in the environment variables the path i found on internet for similar problems, but it doesn't work cause i keep having the error.
        4d43ee2c-2ae9-41b8-a6af-6971c153e42f-image.png

        I use this path cause the paths that i should put initially does not exist ("C:\Qt\bin", "C:\Qt\5.15.2\bin")
        c6cf707c-1f14-4005-af28-c8e3b8208bda-image.png
        a1358f2a-4f6c-46e4-955b-39ff9eca13c0-image.png

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You really should use a project management system such as CMake especially when you want to build a project with a framework such as Qt.

          VS Code has cmake integration which should make your life way easier.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          2
          • S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            @Inderlard said in Can't use open source on VS Code:

            "C:\Qt\5.15.2\msvc2019_64\bin" does'nt work.

            The bin directory is the folder where things like qmake and moc reside. The includes are in C:\Qt\5.15.2\msvc2019_64\include. That is only half of the story. Both qmake projects as well as cmake projects have the ability to add Qt modules. These will correctly add the subfolders which contain the actual headers. You can add the include paths (e.g. C:\QT\5.15.2\msvc2019_64\include\QtCore) by hand, but you certainly should not. Use a CMake-based project to handle all the Qt dependencies and VS Code can work with that.

            1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              You really should use a project management system such as CMake especially when you want to build a project with a framework such as Qt.

              VS Code has cmake integration which should make your life way easier.

              I Offline
              I Offline
              Inderlard
              wrote on last edited by
              #6

              @SGaist @SimonSchroeder Thank you for you'r responses i'll use it.

              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