[Solved] Load Fortran DLL (Microsoft Digital Visual Fortran)



  • Hi,

    Please help me... This is very urgent !!!

    I have create a fortran DLL using Microsoft Digital Visual Fortran Studio. I am trying to load DLL in my Qt application and DLL is not loading... Below is my code

    @
    QString libPath(QString(QApplication::applicationDirPath() + QDir::separator() + "final.dll"));
    QLibrary myLib(libPath);
    bool okLoad = myLib.load(); // check load DLL file successful or not
    bool ok = myLib.isLoaded(); // check is DLL file loaded or not

    typedef void (*FINAL)();
    FINAL mFINAL = (FINAL) myLib.resolve("FINAL");
    if (mFINAL)
    {
    int c = 0;
    FINAL();
    }
    myLib.unload();
    @

    when I run above code ... myLib.load() is returning false

    Please let me know if Qt is compatible with DLL created with Microsoft Digital Visual Fortran Studio.

    thanks in advance,
    Azghar

    EDIT (Gerolf) sourounded code by tags



  • Have you check, if there is some debug output when you call myLib.load()?
    Have you checked with dependecy walker, if all libs that are needed are available?
    Which compiler do you use?

    By the way, Please sourround code by @ tags.

    EDIT:

    in general, it should not be a Qt issue, as Qt is just a set of libaries, you load to your C++ code.



  • Hi Gerolf,

    Thanks a lot for help. I used dependency walker and found that DFORRT.DLL was missing. I copied this DLL to System 32 directory. Now I am able to load DLL and run function.

    thanks,
    Azghar


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.