The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RotateRight on July 01, 2006, 07:43:11 PM

Title: Link Question
Post by: RotateRight on July 01, 2006, 07:43:11 PM
[]
Title: Re: Link Question
Post by: TNick on July 01, 2006, 07:52:24 PM
Why not like this?

include MyFile.inc



;-----MyFile.inc---------------------------------
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\MyLib.lib

Title: Re: Link Question
Post by: Mark Jones on July 01, 2006, 08:42:19 PM
Indeed Mark, sometimes for clarity a "MyFile.inc" file is made alongside the .asm file which contains all the includes, data, etc. Then only this "MyFile.inc" is included from the main .asm file, which then itself includes all the other files.

Note that MASM32 v8 and newer contains a "master" include file for most standard Windows functions, take a look inside \masm32\include\masm32rt.inc. If you include that first in your list of includes, then you can omit any of its contents in your own code. (i.e. the first three startup lines, including windows.inc, kernel32.lib, etc.) This helps to keep things nice and tidy.
Title: Re: Link Question
Post by: RotateRight on July 01, 2006, 10:30:34 PM
[]
Title: Re: Link Question
Post by: sinsi on July 02, 2006, 05:40:54 PM
I use one file called win32.lib which contains the usual libs (kernel32, user32 etc.).
Command is LINK /lib /out:MyLib.lib kernel32.lib user32.lib ...etc
Title: Re: Link Question
Post by: Mark Jones on July 02, 2006, 08:35:30 PM
Quote from: RotateRight on July 01, 2006, 10:30:34 PM
However, this is not what I'm trying to accomplish.
What I want is the ability to link with one file.

That file name should be MyLib.lib and it should
include what is needed so that I do not get link
errors because of ExitProcess and MessageBoxA.

Hi Mark. Sorry for asking for more clarity but there is still a lot of ambiguity here. Did you want to make an app which can be recompiled without the rest of the MASM32 package, or are you just looking to reduce the long list of includes to one .inc and .lib pair for aesthetic reasons? Perhaps you can post some of the code for us to better understand your question.
Title: Re: Link Question
Post by: RotateRight on July 02, 2006, 11:20:41 PM
[]