Search Unity

GDAL DLLnotfoundexception

Discussion in 'Scripting' started by bgman, Oct 8, 2011.

  1. bgman

    bgman

    Joined:
    Feb 17, 2010
    Posts:
    4
    I'm getting the dreaded DLLnotfoundexception for the gdal_wrapper.dll when running a super simple script in an attempt to use the GDAL csharp libraries from http://trac.osgeo.org/gdal/wiki/GdalOgrInCsharp

    From here: http://vbkto.dyndns.org/sdk/ under "GDAL and MapServer latest release versions" I've taken the MSVC2005 (Win32) release, thinking MSVC2005 would be .NET 2.0, and 32bit. Inside the download I took the dll's out of \bin\gdal\csharp.

    With gdal_csharp.dll in my project Plugins folder and gdal_wrapper.dll in C:\Program Files (x86)\Unity\Editor, I get DLLnotfoundexception for the gdal_wrapper.

    I've pasted gdal_wrapper all over the place, including windows/system32, root of my Unity Project, so on and so forth... with no luck. I've also tried adding various locations to my PATH, and trying other releases like the MSVC2008, the 2005 64bit (I'm on Vista64 SP2), all with the same result.

    I've successfully used Maptools, with its maptools.dll in the Unity project's Plugins folder and shaplib.dll in C:\Program Files (x86)\Unity\Editor. Works. Linky: http://shapelib.maptools.org/dl/contrib/DotNetArchive.zip. I was so excited to get the Maptools stuff working then on to this and the big 'whomp whomp' tuba sound :) Any ideas, or even how would I go about troubleshooting this? Maybe I am missing a Microsoft redistributable?

    much appreciated
    T
     
  2. bgman

    bgman

    Joined:
    Feb 17, 2010
    Posts:
    4
    Update: Works! Through Dependency Walker I found what it was really looking for. I guess Unity only reports the top level DLL as missing when the actual missing DLL(s) are deeper.
     
  3. prismpeppe

    prismpeppe

    Joined:
    Jan 15, 2015
    Posts:
    6
    Hi, can you explain me how do you have solve the problem???

    Thanks!
     
  4. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    He was missing the DLLs that the plugin needed.
     
  5. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,191
    Anyone else have luck getting this working? I am attempting the same thing as this user and receiving the same error. I tried using Dependency Walker to find the missing DLL's, and have imported each one, but it's still not working. The missin DLLs (as far as I could tell) are gdal202, msvcp90, and msvcr90.
     
  6. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    In case it helps anyone, here's the steps I followed:

    1. Navigate in your browser to https://www.gisinternals.com/

    2. Download stable x64 version (e.g. I got release-1911-x64-gdal-3-0-0-mapserver-7-4-0.zip) and unpack to a folder. This assumes you are using 64-bit build. For 32-bit there's an x86 version available instead, but I haven't tried it.

    3. Create a Plugins/GDAL folder under your Assets folder in Unity

    4. In unpacked folder, go to bin/ and copy any .dll file to Assets/Plugins/GDAL folder

    5. Go to bin/gdal/csharp/ and copy any .dll file to Assets/Plugins/GDAL folder

    6. Go to bin/ms/csharp/ and copy any .dll file to Assets/Plugins/GDAL folder
    And that should pretty much do it.