News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Static Library

Started by Richard van Petrov, June 06, 2010, 06:33:15 PM

Previous topic - Next topic

Richard van Petrov

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

ragdog

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,


Richard van Petrov

Thank you, I have it working.

Tedd

I would guess python functions will require C calling convention, which will make a difference when you have parameters to push.
No snowflake in an avalanche feels responsible.