Silverfrost Logo About Us | Contact Us

Command line mode

In this mode all of the object files and SLINK commands are placed on the command line.

SLINK [files] [options] [commandfile]

Object files, script files and options may be freely intermixed. There may be more than one command file.


1. Script files

Script files contain commands and/or object files.

Interactive style script files are prefixed by a "$" or have no prefix. Command line script files are prefixed by an "@".


2. Interactive style script files

These contain the same commands as may be used in interactive mode and are executed in the order that they appear in the file.


SLINK myprog

If myprog (no filename extension) does not exist then myprog will be assumed a interactive style script file.


SLINK $myprog

This form is explicitly a interactive style script file.


3. Command line style script files and command line arguments

These may contain the following commands:

-addobj:{@listfile | filename}


-archive:[filename]    alias for -implib


-debug [:full| :partial| :none]


-dll [:modulename]    alias for -library


-export:entryname [=internalname]



-file [:filename]    alias for -out


-heap:reserve [,commit]

-help    alias for -?

-imagealign:#    alias for -align

-imagebase:address    alias for -base

-implib [:filename]

-library [:filename]

-map [:filename]


-out [:filename]

-rlo :dllname


-subsystem:{native | windows | console}

-vc[:baseaddress[,commit]]  alias for -virtualcommon

-virtualcommon[:baseaddress[,commit]] alias for -vc

Commands have the same requirements and meaning as the corresponding interactive command, may be in upper or lower case and may have either a "/" or a "" prefix.

Commands are executed first and so may appear anywhere and in any order. Object files are scanned after all of the commands have been scanned.

Object file names are specified with the .OBJ extension and, unlike interactive mode no extension is automatically appended. However, object files are loaded in the order in which they appear.

The -out: (-file:) command is unnecessary since an executable will be automatically written after all commands have been processed and all object files have been scanned. For example:

SLINK myprog.obj -map: @others.inf -file:test @defltlib.inf

This will link the object file myprog.obj with any object files, libraries, or DLLs listed in others.inf or defltlib.inf. A map file myprog.MAP will be produced (name taken from the first loaded object) and executable test.EXE (automatic file name extension) written. For example:

SLINK tester.obj mylib.obj

tester.obj is scanned and then mylib.obj is scanned. An executable named tester.EXE will be written.

It is generally not advisable to mix interactive and command line style script files due to their different behaviour. If more than one interactive style script file is used remember that commands are executed in the order in which they appear.



Copyright © 1999-2017 Silverfrost Limited