The MASM Forum

General => The Campus => Topic started by: Lonewolff on March 15, 2016, 01:49:21 PM

Title: Creating inc and lib files
Post by: Lonewolff on March 15, 2016, 01:49:21 PM
Hi Guys,

Long time since I posted around these parts (so long that it looks like the forum had a refresh since I last logged on and I had to re-create my account - LOL).

I am looking to make a basic DirectX library (for the fun of it and to refresh my memory with MASM32). I have googled around and just cant remember how to format the '.inc' files and how to convert these to the corresponding '.lib'.

I'll only be using a basic subset of commands whilst I get my feet back on the ground with this :)

To pre-empt the question 'why re-invent the wheel?' as I said it's predominantly to re-educate myself on the process (and re-inventing the wheel is what assembly coders do, right? Hehe!).

Thanks in advance guys and great to be back! :)
Title: Re: Creating inc and lib files
Post by: Lonewolff on March 15, 2016, 02:30:05 PM
I have made some progress.

I am testing with the MessageBox function and have created a simple file 'test.inc'


MessageBoxA PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD
IFNDEF __UNICODE__
  MessageBox equ <MessageBoxA>
ENDIF


I have run this through inc2l.exe to build a 'lib' file.

The program compiles correctly, but when I run it, it tells me that test.dll is missing.

[edit]
Sorry for the double post too - just found the edit button, it didn't really stand out.  :)

I just found that you can just pull the lib files straight from the latest windows SDK also and the application compiles fine.

So this makes me wonder, what is the purpose of inc2l.exe then? What am I missing?



Title: Re: Creating inc and lib files
Post by: jj2007 on March 15, 2016, 04:42:51 PM
see Calling functions in DLL files (http://masm32.com/board/index.php?topic=4905.msg52695#msg52695).

And welcome back :icon14:
Title: Re: Creating inc and lib files
Post by: Lonewolff on March 15, 2016, 09:50:33 PM
Thanks for the link, checking it out now :)
Title: Re: Creating inc and lib files
Post by: Adamanteus on March 16, 2016, 04:49:55 AM
 As I remember it was also in this topic (http://masm32.com/board/index.php?topic=1255.45)  :t
Title: Re: Creating inc and lib files
Post by: Vortex on March 17, 2016, 06:22:06 AM
Hi Lonewolff,

You can use Hutch's inc2l tool or Pelle's library manager polib to build import libraries.