1

im migrating a project from netbeans to VScode and now i need to configure the compiler for everything manually, but i ran into 2 issues

1) for some reason when i use g++ on the terminal it works, with errors from the program but it works, but if i try running the task.json from Vscode itself it wont show me anything and just stay on "Initiaded Task" unless i close the terminal

2) and even when i configure the c_cpp_properties.json with all the includes paths, intellisense keeps saying me it cant find the file, either from my header inside a folder or the Qt header files.

im pasting both json files here, meabe im missing something

c_cpp_properties.json

   {
    "configurations": [
        {
            "name": "Mingw64 Qt5.11",
            "includePath": [
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtCore",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtGui",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtWidgets",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtSql",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtSerialPort",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtPrintSupport",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtNetwork",
                "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtConcurrent",
                "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo/Headers",
                "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo/Cpp",
                "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo",
                "${workspaceFolder}"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:/Qt/Qt5.11.3/Tools/mingw530_32/bin/g++.exe",
            "cStandard": "gnu17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-gcc-x86",
            "browse": {
                "path": [
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtCore",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtGui",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtWidgets",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtSql",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtSerialPort",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtPrintSupport",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtNetwork",
                    "C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtConcurrent",
                    "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo/Headers",
                    "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo/Cpp",
                    "C:/Users/Patron/Desktop/Code Projects/Sistema_Silo"
                ]
            },
            "compileCommands": "${workspaceFolder}/build/compile_commands.json",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

Task.json

    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // https://stackoverflow.com/questions/30064686/making-and-compiling-c-projects-with-multiple-files
    // for the documentation about the tasks.json format
    // https://www.softwaretestinghelp.com/cpp-makefile-tutorial/
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "g++ compilar Silo SaS",
            "command": "C:\\Qt\\Qt5.11.3\\Tools\\mingw530_32\\bin\\g++.exe",
            "args": [
                //"--verbose",
                "-std=c++14",
                "-Wall",
                //"-c",
                //"-g",  // debuging mode
                //"-o",  // output name
                // "${fileDirname}        
        
        // hay que incluir todas las direcciones de Qt, y tambien los *.h
        //"${fileDirname}",
        //"-I C:/Users/Patron/Desktop/Code Projects/Sistema_Silo",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include",
                // "-LC:/Qt/Qt5.11.3/5.11.3/mingw53_32/lib",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtCore",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtSql",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtWidgets",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtPrintSupport",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtNetwork",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtGui",
        "-I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtConcurrent",
                // aqui van los cpp
        //"*.cpp",
        "Cpp/Silo_SaS.cpp",
        "Cpp/main_Pantalla_Principal.cpp",
        "Cpp/Generales.cpp",
        "Cpp/Impresora.cpp",
        "Cpp/Launcher.cpp",
        "Cpp/Login.cpp",
        "Cpp/Serial.cpp",
        "Cpp/Servidor_Rpi.cpp",
        "-o",
        "dist/Debug/Vscode_Windows/Sistema_Silo_Windows_VScode_1_4.exe",
// g++ -std=c++14 -Wall -I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include -I C:/Qt/Qt5.11.3/5.11.3/mingw53_32/include/QtCore -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtSql -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtWidgets -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtPrintSupport -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtNetwork -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtGui -I C:\Qt\Qt5.11.3\5.11.3\mingw53_32\include\QtConcurrent "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Silo_SaS.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\main_Pantalla_Principal.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Generales.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Impresora.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Launcher.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Login.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Serial.cpp" "C:\Users\Patron\Desktop\Code Projects\Sistema_Silo\Cpp\Servidor_Rpi.cpp" -o /dist/Debug/Vscode_Windows/Sistema_Silo_Windows_VScode_1_4.exe 

            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "compilador: C:/Qt/Qt5.11.3/Tools/mingw530_32/bin/g++.exe"
        }
    ]
}
lightshadown
  • 165
  • 1
  • 1
  • 10
  • @Super-intelligentShade yes, the question was how do i make sure vscode detect all qt related headers, because its unable to found them – lightshadown Jun 18 '22 at 16:27
  • Oh OK. I couldn't tell, as the only thing you've posted was that you ran into 2 issues. This might help you in the future: https://stackoverflow.com/help/how-to-ask – Super-intelligent Shade Jun 18 '22 at 17:51

1 Answers1

-1

Why don't you use Qt Creator? You can download open-source program for free, after installing you'll have all set up and be ready to code there.

ivanlp4
  • 1
  • 2
  • 2
    This isn't helpful in solving the issue being asked. Please be mindful when posting a solution that it solves the issue being asked. – Fred Nov 29 '22 at 15:29