General Mechanical

General Mechanical

binlib.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x368

    • song
      Subscriber

      I want to use binlib.dll in ansys. Therefore, I try to compile ResRdDemo.F against binlib.dll. Both binlib.dll and ResRdDemo.F are copied from Ansys student 19.0.


      Environment and compiler are as follows:


      windows 8.1


      compiler: Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on IA-32,
      Version 18.0.5.274 Build 20180823


      Command 1: ifort ResRdDemo.F binlib.dll


      output:


      Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on IA-32,
      Version 18.0.5.274 Build 20180823
      Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.
      ifort: command line warning #10161: unrecognized source type 'binlib.dll'; objec
      t file assumed


      ResRdDemo.F(5): warning #5117: Bad # preprocessor line
      #include "impcom.inc"
      -^
      ipo: warning #11010: file format not recognized for c:UsersUserDesktopbaoan
      sysbinlibbinlib.dll
      Microsoft (R) Incremental Linker Version 14.00.24215.1
      Copyright (C) Microsoft Corporation.  All rights reserved.


      -out:ResRdDemo.exe
      -subsystem:console
      ResRdDembj
      binlib.dll
      binlib.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x368


      ResRdDembj is created, but no executable file exists. But I think the first issue  #include "impcom.inc" is caused by no preprocessing option. Then, how about the second problem "binlib.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x368"? Therefore, I introduce option /E, see command 2.


      Command 2: ifort /E ResRdDemo.F binlib.dll


      no output file is created. I can not see any errors neither.


      I want to know  this issue is caused by binlib.dll  or ifort version issue or others?


      Any help or comments are appreciated.


      Song


       


       


       

    • Mike Rife
      Ansys Employee

      Song


      The ifort command is missing a lot of flags.  Please see the following Help section:


      ANSYS 19 Help -> Mechanical APDL -> Programmer's Reference -> I Guide to Interfacing with ANSYS -> Chapter 2.1 Accessing ANSYS Binary Files -> 2.1.1 Access Routines to Results, Substructure, and Matrix Files. 


      Scroll down to 'On Windows Systems'.  There it gives instructions on linking those demonstration files.  There are some bat files in the Ansys Install that you can use to compile these.  And not use the ifort command directly.  Or I suppose you could read through the bat file then update your ifort command usage as needed.


      Also the Ansys Student version supports Windows 10 and not 8.1.  I believe the website will be updated to reflect this.  Plus the compiler version being used does not seem to be supported.  See the following for the supported compiler version:


      ANSYS Help -> Installation & Licensing Guide -> Windows Installation Guide -> Chapter 2.2. Compiler Requirements for Windows Systems


       


      Mike

    • song
      Subscriber

      Hello Mike,


      Thank you for your clear and detailed explanation. I appreciate it. However, I use ansys student 19.0 version. The problem is that  ansys student 19.0 version neither have a batch file "rdrwrt.bat" nor "custom" directory. Therefore, I do not know what flags are set in "rdrwrt.bat" or what flags must be set for binlib.dll use. The directory setting of ansys student 19.0 version is as follows:


      C:Program FilesANSYS IncANSYS Studentv190ansyscustomizeinclude


      C:Program FilesANSYS IncANSYS Studentv190ansyscustomizeuser


      Is an ansys student version not allowed to use "rdrwrt.bat" and binlib.dll? If an ansys student version does not allow to use binlib.dll, why is binlib.dll installed?


      Any more help or suggestions are appreciated.


      Song


       


       

    • song
      Subscriber

      thank you, it is solved.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.