Hi,
Here comes a test code for both import problems and to solve them:
file Libx64.pb
Code: Select all
Structure D3DXMATRIX
_11.f
_12.f
_13.f
_14.f
_21.f
_22.f
_23.f
_24.f
_31.f
_32.f
_33.f
_34.f
_41.f
_42.f
_43.f
_44.f
EndStructure
Import "d3dx9.lib"
D3DXMatrixRotationX (*pOut.D3DXMATRIX, Angle.f)
EndImport
ProcedureDLL OneX (*Test.D3DXMATRIX, Angle.f)
ProcedureReturn D3DXMatrixRotationX (Test, Angle)
EndProcedure
Global *D3DDevice.IDIRECT3DDEVICE9
ProcedureDLL mytest()
*D3DDevice.IDIRECT3DDEVICE9
*D3DDevice\Clear(0,0,0,0,0,0)
ProcedureReturn 1
EndProcedure
;OneX (*Test.D3DXMATRIX, 10)
First problem the interface -> procedure problem
If you look to the asm code x86 you see in mytest.asm
Code: Select all
format MS COFF
Public PB_mytest
Extrn Libx64_p_D3DDevice
section '.text' code readable executable
in the x64 mytest.asm you see the "Extrn rax+344" if you delete them the asm file works
Code: Select all
format MS64 COFF
Public PB_mytest
Extrn rax+344
Extrn Libx64_p_D3DDevice
section '.text' code readable executable
now the second problem, the wrong import name problem
If you look to the asm code x86 you see in OneX.asm
Code: Select all
format MS COFF
Public PB_OneX
Extrn _D3DXMatrixRotationX@8 ( -> this is the correct importname from the dx9 "d3dx9.lib")
section '.text' code readable executable
in the x64 OneX.asm you see a wrong function name. If you delete "Libx64_" in the the asm file it works, if not you cant use the OneX (*Test.D3DXMATRIX, 10) command, the Polilink error (command name not found) appears. "Libx64" is the name of the pb file
Code: Select all
format MS64 COFF
Public PB_OneX
Extrn Libx64_D3DXMatrixRotationX ( the correct importname is D3DXMatrixRotationX, you must change it to "Extrn D3DXMatrixRotationX"
section '.text' code readable executable
my workaround is the "Wrong line ins ASM Killer programm"
Code: Select all
;Wrong line ins ASM Killer programm
kill.s = "Libx64"
Directory$ = GetCurrentDirectory() ; Listet alle Einträge auf C:\ auf (ohne die Inhalte aus Unterverzeichnissen)
If ExamineDirectory(0, Directory$, "*.asm")
While NextDirectoryEntry(0)
Text$ = ""
FileName$ = DirectoryEntryName(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
If ReadFile(0, FileName$ ) ; wenn die Datei geöffnet werden konnte, setzen wir fort...
While Eof(0) = 0 ; sich wiederholende Schleife bis das Ende der Datei ("end of file") erreicht ist
find$ = ReadString(0)
find$ = ReplaceString(find$, kill + "_D3DX","D3DX")
If Left(find$,9) <> "Extrn rax"
Text$ + find$ +Chr(13)+Chr(10)
EndIf
Wend
CloseFile(0) ; schließen der zuvor geöffneten Datei
EndIf
DeleteFile(FileName$ )
If OpenFile(0, FileName$ ) ; wenn die Datei geöffnet werden konnte, setzen wir fort...
WriteString(0, Text$ )
EndIf
EndIf
Wend
FinishDirectory(0)
EndIf
with this workaround i can make my lib...
i hope this help
Michael