Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3986

Xojo says my VS2022 64-bit .lib /.dll contains an error?

$
0
0

I have a 64-bit .dll with its .lib compiled by Visual Studio 2022. The subroutine, called DLLTEST, adds two 4-byte integers into a third 4-byte integer. Dumpbin.exe reports that all is as expected…

Xojo compiles, but when I try to use the .dll in a 64-bit Xojo app, there is this error message:
“… DLLTEST.lib is either not designed to run on Windows or it contains an error … error status 012f”

The Xojo External Method matches the .dll. Here is the method:
Method: DLLTEST
Parameters: byref in1 as integer, byref in2 as integer, byref out1 as integer
Return type: blank (this .dll is a subroutine)
Lib: DLLTEST.Lib

(have also tried SOFT DECLARE SUB)

Here is the VS2022 code. It is Intel IFORT Fortran:
subroutine DLLTEST (IN1, IN2, OUT1)
!DEC$ ATTRIBUTES DLLEXPORT::DLLTEST
!DEC$ ATTRIBUTES REFERENCE:: IN1, IN2, OUT1
integer*4 IN1, IN2, OUT1
OUT1 = IN1 + IN2
end

I have tried variables byref and byvalue, and also compiled the routine as a subroutine and a function, with matching Xojo external methods. Always the same error message.

Any suggestions about the error?

This is similar to Make and Call AddTwo from DLL but that was for a 32-bit .dll

6 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 3986

Trending Articles