Coder Social home page Coder Social logo

Comments (26)

tbeu avatar tbeu commented on May 22, 2024

The library should work out-of-the-box with Dymola. ModelicaExternalC.dll (and in fact all DLLs) is not required by Dymola. Only ED_XMLFile.lib and expat.lib from the library and ModelicaExternalC.lib from the Dymola installation are needed for linking an executable of XMLTest1.

from externdata.

jnangle avatar jnangle commented on May 22, 2024

That's what I thought should happen. However, I get the error message above when I use version 1.0.2 of ExternData.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Did you open package.mo in Dymola? What happens if you delete all DLLs from the Library dirs?

from externdata.

tbeu avatar tbeu commented on May 22, 2024

You must not use ExternData\Resources\thirdParty\ITI\win32\ModelicaExternalC.lib with Dymola. This is only for building the DLLs for SimulationX from ITI. Dymola provides its own ModelicaExternalC.lib.

from externdata.

jnangle avatar jnangle commented on May 22, 2024

Deleting all of the DLL files from the ExternData Library folders seems to have fixed the problem. The simulations run and I no longer get the error message. Thank you for your help and your quick responses.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Glad that it works for you. But strange, I thought I checked this. I'll try to reproduce it next week with Dymola 2015 and 2016. I'll leave this issue open meanwhile.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Actually I cannot reproduce the problem you mentioned with Dymola 2016. I downloaded ExternData 1.0.2 from the releases, extracted it to an empty directory and opened package.mo in Dymola 2016. The example models work out of the box.

from externdata.

thorade avatar thorade commented on May 22, 2024

I can confirm this issue exists. Did a fresh clone, then tried to run XMLTest1 with Dymola 2016.

dymola_externdata

from externdata.

tbeu avatar tbeu commented on May 22, 2024

@thorade Thank you for reproducing the issue. If I only would know what goes wrong here? Do you have any clue (since you are an experienced Dymola user)?

from externdata.

thorade avatar thorade commented on May 22, 2024

I believe it might be related to another issue I once encountered:
ibpsa/modelica-ibpsa#40
If I manage to fix it, I will report a solution here.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Do you use MSVC or MinGW compiler? In my case it is MSVC.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

In case of MSVC the linker option /VERBOSE:Lib displays a list of found lib dependencies.

from externdata.

thorade avatar thorade commented on May 22, 2024

I tried Visual Studio 2013 Community Edition, all examples have the same error.
The fix suggested by jnangle works:
After deleting all dll files from ExternData\ExternData\Resources\Library\win32 the examples simulate.
This also means that my first idea for a fix was wrong, must be something else.

Where would I specify the linker option and where can I find the output?

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Please set /VERBOSE:Lib in file build.bat of your "Dymola 2016\bin" install directory. Edit line 197 from

set LINK=%DYMOLALINK% /stack:0x500000 /NODEFAULTLIB:LIBCD /NODEFAULTLIB:LIBC /NODEFAULTLIB:LIBCMT /OPT:NOREF  %liblink% %libdsLib% %DELAYARG1% %DELAYARG2% dymosim.obj %EXTRALIB% 

to

set LINK=%DYMOLALINK% /VERBOSE:Lib /stack:0x500000 /NODEFAULTLIB:LIBCD /NODEFAULTLIB:LIBC /NODEFAULTLIB:LIBCMT /OPT:NOREF  %liblink% %libdsLib% %DELAYARG1% %DELAYARG2% dymosim.obj %EXTRALIB% 

Please run the translation again and watch the output in the Dymola log.

from externdata.

thorade avatar thorade commented on May 22, 2024

OK, I changed that line and here is the complete content from the buildlog.txt:

Compiling and linking the model (Visual C++). 

dsmodel.c

Searching libraries
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wsock32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comctl32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\netapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\dnsapi.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wininet.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ws2_32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shlwapi.lib:
    Searching C:/Program Files (x86)/Dymola 2016\bin\lib\libds.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\OleAut32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wbemuuid.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wintrust.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\crypt32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\delayimp.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\ED_XMLFile.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\expat.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\MSVCRT.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wsock32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comctl32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\netapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\dnsapi.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wininet.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ws2_32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shlwapi.lib:
    Searching C:/Program Files (x86)/Dymola 2016\bin\lib\libds.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\OleAut32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wbemuuid.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wintrust.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\crypt32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\delayimp.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\ED_XMLFile.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\expat.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\MSVCRT.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wsock32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comctl32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\netapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\dnsapi.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wininet.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ws2_32.lib:

Finished searching libraries
   Creating library dymosim.lib and object dymosim.exp

Searching libraries
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib:

Finished searching libraries

Searching libraries
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wsock32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comctl32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\netapi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\dnsapi.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\wininet.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ws2_32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shlwapi.lib:
    Searching C:/Program Files (x86)/Dymola 2016\bin\lib\libds.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\OleAut32.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wbemuuid.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\Wintrust.lib:
    Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\crypt32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\delayimp.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\ED_XMLFile.lib:
    Searching C:/Users/mthorade/Documents/Dymola/ExternData/ExternData/Resources/Library/win32\expat.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\MSVCRT.lib:

Finished searching libraries
LINK : warning LNK4199: /DELAYLOAD:ED_XMLFile.dll ignored; no imports found from ED_XMLFile.dll

Successful generation of Dymosim. 

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Thanks. Looks OK though since ED_XMLFile.lib and expat.lib are linked as expected.

Need to check the linker warning about the imports. Oops!! This is the problem: ED_XMLFile.dll must not be there.

from externdata.

thorade avatar thorade commented on May 22, 2024

OK, I will do that.
As deleting the dlls from the Resources\Library\win32 directory seems to fix the problem, I would assume they are the problematic part!? Are they needed or would it be an option to deliver the library without dlls?

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Yes, indeed. The link instruction (line 197 of build.bat) contains this DELAYLOAD: option. Since ED_XMLFile.dll and ED_XMLFile.lib have the same name this leads to the conflict.

The reason why there are both ED_XMLFile.dll and ED_XMLFile.lib in Resources\win32 is simple. This way the lib should work out-of-the-shelf with SimulationX and Dymola (on Win). SimulationX requires the DLL only and Dymola the LIB.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

I'll rename ED_XMLFile.dll to ITI_ED_XMLFile.dll and will release a new version soon.

from externdata.

thorade avatar thorade commented on May 22, 2024

Dependecy Walker gives following warning for dymosim.exe:

Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

But I did not yet find which module it is.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

@thorade Can you please git clone again (to a new directory) and check simulation with Dymola again. Should be fixed by 26754cb.

from externdata.

thorade avatar thorade commented on May 22, 2024

Yes, now it works out of the box!

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Thanks.

from externdata.

thorade avatar thorade commented on May 22, 2024

Thanks!
I might be using the JSON reader in the future.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Sure. Tell me if you see improvement.

from externdata.

tbeu avatar tbeu commented on May 22, 2024

Argh, commit links should go to #3.

from externdata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.