Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2831 closed defect (fixed)

OMEdit fails to find local dlls on Windows

Reported by: Per Östlund Owned by: Adeel Asghar
Priority: high Milestone: 1.9.4
Component: OMEdit Version: trunk
Keywords: Cc:

Description

If a model uses an external function which specifies a library by using the Library annotation, and the library is in a DLL in the same folder as the model, then OMEdit will fail to execute
the simulation executable. The error message isn't very user friendly, just stating that the simulation crashed and returned the error code -1073741515, which is 0xC0000135 == STATUS_DLL_NOT_FOUND. The reason is simply that OMEdit runs the simulation in %TEMP%/OpenModelica/OMEdit/ and not the folder the model is in, so it will fail to find the dll.

On Linux this works automagically, and it would be nice if it would work on Windows too (and maybe MacOS, I haven't tried it). And maybe it's possible to display error codes in a human readable format too?

Attachments (2)

ExcelReaderTest.mo (1.6 KB ) - added by Per Östlund 10 years ago.
ExcelReader.c (1.3 KB ) - added by Per Östlund 10 years ago.

Download all attachments as: .zip

Change History (7)

by Per Östlund, 10 years ago

Attachment: ExcelReaderTest.mo added

by Per Östlund, 10 years ago

Attachment: ExcelReader.c added

comment:1 by Per Östlund, 10 years ago

Attached is a test model which uses an external object to read from an excel sheet, which uses libxl. No excel sheet is included, the model should just print an error message that it couldn't open the sheet if it works, or crash if it doesn't.

comment:2 by Adeel Asghar, 10 years ago

Ofcourse this can't work automatically. For translating the model I have to specify the libxl include files directory via cflags option.

If user downloads and installs the libxl in Windows PATH then the system will automatically find the needed header files for compilation and dll for execution.

I don't know how you install libxl in Linux. Perhaps it is in PATH. Because even in Linux OMEdit working directory is %TEMP%/OpenModelica/OMEdit/ so how can OMEdit find the binary?

Also the user can set the working directory via Options before running the simulation.

comment:3 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in r25450.

comment:4 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:5 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.