Important: Please read the Qt Code of Conduct -

QT and GDAL , no errors but the console application not showing anything

  • dera all,
    here is my code :
    #include <QCoreApplication>
    #include <iostream>
    #include <gdal_priv.h>
    #include <cpl_conv.h>
    using namespace std;
    #include <iostream>
    int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);
    const char *input ="C:/Users/plt/Documents/untitled3/IMAGERY.TIF";
    const char output ="C:/Users/plt/Documents/untitled3/new_IMAGERY.TIF";
    GDALDataset pOlDS, * pNewDS;
    GDALDriver pDriverTiff;
    pDriverTiff= GetGDALDriverManager()->GetDriverByName("GTiff");
    pOlDS = (GDALDataset
    ) GDALOpen(input,GA_ReadOnly);
    pNewDS = pDriverTiff->CreateCopy(output, pOlDS, FALSE, NULL, NULL, NULL);

    return a.exec();
    i do not have errors and it is executing but the process is not done.

  • Lifetime Qt Champion


    I don't know that library but I don't see any error checks in your code.

    Also, are you sure that this library supports slashes in file path on Windows ?

  • thanks for the zour answer , after checking the ".exe "file i found that the execution in fact had some errors due to missed DLLs , thats why in included the missed ones inside the solution file beside the ".exe" and it worked

  • Lifetime Qt Champion

    This post is deleted!

Log in to reply