I have been trying to find the distance between 2 points using QGIS C++ APIs in Qt. I used the following code :

 QgsDistanceArea d;
 qDebug()<< "Qgspoint"<< d.measureLine(p1,p2) where p1 and p2 are QgsPoint.

when I run the application through Qt IDE this gives the correct output. but when I run the .exe file of the same application from its release folder, it gives very low value and incorrect value. Which DLL am I missing for calculating the distance?

  • 1
    Why are you convinced that this is a DLL issue? If you are getting an error, you should place that error (as text) prominently in the question.
    – Vince
    Sep 10, 2021 at 17:16
  • I am not getting errors. I am getting incorrect answer for the same code when I run the .exe file from the release folder. As far as I know when I run the .exe file, then supporting libraries are DLL files. Sep 10, 2021 at 17:59
  • 2
    If a DLL were missing the app would fail to run, so it's NOT a missing DLL.
    – Vince
    Sep 10, 2021 at 18:31
  • my GitHub repository(github.com/PuneetKumar555/QGIS_MAP_OPERATIONS). I made this application. I have also added India.tiff file(raster file) on which I am doing some calculations. follow these steps: layer-> add raster layer(india.tiff) -> geometrical measurements(line geometry) -> draw two line to find distance between them.It gives correct result(with distanceunits in distancemeters) when I run it from QT IDE. but when I run qgis_demo.exe file from release folder, the same code gives results in exponential(distance unit in distacnedegrees). Sep 20, 2021 at 10:59


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.