News:

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

Unused Procs in Include files

Started by RedXVII, December 06, 2006, 10:58:41 PM

Previous topic - Next topic

RedXVII

Is there anyway of getting masm to EXCLUDE proc's that are in my include files that arent called/needed?

Scenario: Ive have an include file with a few common functions in them for win32 programming, I include it in my new project in order to use ONE of the functions from it. But masm being clever (but somewhat not clever in this case) includes the other unused functions aswell. Is there an easy solution besides deleting them?

Cheers
RedXVII  :U

hutch--

red,

The only solution is basically to seperate equate, prototype and struct/union data from runtime code and you will never have the problem. You can have the code within a MACRO and this will not be added if you don't call the macro but if you have open procedures in include file data, it gets added to your exe if you call the include. Maybe try something like this.

EnableMyCode MACRO
.const
MyCode PROTO args etc ....
.code
MyCode proc args etc ....
  ; your code here
MyCode endp
ENDM
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

u

The only good solution is to put the procs in a .lib, after separating them into different .asm (thus  .obj) files. The linker then will be intelligent enough to link only the .obj's (procs) that you currently use.
Please use a smaller graphic in your signature.