How do I create a static library in MASM to embed into other applications? [RESOLVED]
.486
.model flat, stdcall
option casemap:none
include python26.inc
includelib python26.lib
.code
start:
invoke Py_Initialize
invoke Py_Finalize
invoke ExitProcess, 0
end start
Hi
here is an example
python26.asm
.486
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
.code
Py_Initialize proc
ret
Py_Initialize endp
Py_Finalize proc
ret
Py_Finalize endp
end
Add In your include file python26.inc
Py_Initialize PROTO
Py_Finalize PROTO
Create a bat or cmd and paste it
c:\masm32\bin\ml /c /coff python26.asm
c:\masm32\bin\link -lib python26.obj /out:python26.lib
pause
greets,
Thank you, I have it working.
I would guess python functions will require C calling convention, which will make a difference when you have parameters to push.