Hi,

i want to create a .lib file which contains functions i often use, so i can include them in my projects.
Do i have to use a special Syntax? I coded sth like this:

.386 
.model flat,stdcall
option casemap:none

include kernel32.inc
includelib kernel32.lib

.data
szSth db "sth", 0

.code

Func1 proc
Ret
Func1 EndP


Func2 proc szSomething:DWORD
ret
Func2 endp

end


Is this a correct Syntax for a .lib file?

Besides i created a .inc file, which contains these lines:
Func2 proto :DWORD
Func1 proto


is this correct?

thx for replies ;)

PS: Sorry for my bad english :P
Posted on 2006-07-07 05:22:36 by n0p
I would add "option proc:private", then do "public FuncWhatever". Finally, use lib.exe to add your .obj files to a .lib - and you should be set.
Posted on 2006-07-07 05:28:04 by f0dder
sry, i don't understand what u mean :X
Can you post a sample code?
Posted on 2006-07-07 05:37:24 by n0p

.386
.model flat,stdcall
option casemap:none
option proc:private ; so only routines we mark PUBLIC are, indeed, PUBLIC

PUBLIC Func1
PUBLIC Func2

include kernel32.inc
includelib kernel32.lib

.data
szSth db "sth", 0

.code

Func1 proc
Ret
Func1 EndP


Func2 proc szSomething:DWORD
ret
Func2 endp

end


then...


ml /c /coff file1.asm
lib /out:my.lib file1.obj

Posted on 2006-07-07 05:41:07 by f0dder
ah, okay, thank you very much!

"ml /c /coff file1.asm
lib /out:my.lib file1.obj"
^^to create the .lib file? I work with WinAsm Studio, so it will be generated automatically ;)

Is my inc-file correct?
"Func2 proto :DWORD
Func1 proto"
Posted on 2006-07-07 05:50:23 by n0p
Yes, the .inc file looks just fine to me :)
Posted on 2006-07-07 06:04:46 by f0dder
okay, thx, but i have another question :D

After all my lib-file contains some pathes like "C:\WinAsm\bla\bla.obj" or "C:\masm32\lib\kernel32.lib". Is this normal?

It works, but does it work on other computers? I want to share this lib with my firends ;)

Edit: Doesn't found problem :(
Posted on 2006-07-07 06:33:10 by n0p
Hardcoded paths are bad for your health :)
Posted on 2006-07-07 08:43:00 by f0dder