Is there any C++ library that can convert ESRI Shapefile to DXF/DWG file?

I seek a link/or sample on how this can be done with the said C++ library.

I'm aware that one can do this with ArcGIS Desktop application itself, but this is not what I want. I want to write code that can do this with my own UI.

  • 1
    Why is it being put on hold? I thought this is perfectly answerable? There is at least one answer (right or wrong is an entirely different issue) that addresses this well within the scope
    – Graviton
    Nov 30, 2018 at 9:55
  • 2
    I would have voted to close this question as primarily opinion-based. It is broad, but it encourages list-building, which isn't compatible with the "Focused question/Best answer" model used here.
    – Vince
    Nov 30, 2018 at 13:21
  • 1
    Since you have GDAL provided as an answer you could focus your question on that. If it does not meet your requirements just ask another focused question.
    – PolyGeo
    Nov 30, 2018 at 23:28

1 Answer 1


GDAL supports open ESRI Shapefile and save it as DXF. The C++ API intro is here: https://gdal.org/ogr_apitut.html

  • Do you have the relevant documentation section that shows how to achieve this in GDAL?
    – Graviton
    Nov 30, 2018 at 9:56
  • 1
    All documentation are available at gdal.org. The case with converting one format to another are described at tutorial gdal.org/ogr_apitut.html. Also you can look at ogr2ogr command line utility and it sources. Nov 30, 2018 at 11:01
  • You mean doing something like using ogr2ogr command line utility conversion?
    – Graviton
    Dec 3, 2018 at 3:45
  • You can try command line utility and if it suits you - you can see sources how file format conversion (for example between ESRI Shape to DXF) done. And use this code in you application/library. Dec 3, 2018 at 7:14
  • You mean, I would have to look into the source code on how the conversion is done?
    – Graviton
    Dec 3, 2018 at 7:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.