SML# Document Version 4.0.0
28 The smlsharp command

28.4 Link options

The following options control the behavior of linker. All options in this category also affects the interactive session.

-llibrary

Link with the specified library. In interactive session, this option allows the user to import functions in the given library interactively.

-Ldir

Add the directory dir to the library search path. If more than two -L options are specified, it searches for libraries in the given order.

-nostdlib

Search for libraries only in directories specified by -L options.

-c++

Use C++ compiler driver instead of C compiler driver for linking. This is needed to link a SML# program with C++ libraries.

-Wl args, -Xlinker arg

Add args to the additional arguments to be passed to the C/C++ compiler driver command when linking. args of -Wl is a comma-separated list of arguments. -Xlinker specifies just one argument. If more than two of them are specified, all of them are passed to C/C++ compiler driver command in the given order.

-filemap filename

Use filename as the map of filenames that the compiler uses for searching for files. The smlsharp command attempts to obtain object file name by replacing the .smi suffix of a .smi file with .o. By specifying this option, you can change this correspondence. Each line of the given file must be a = sign followed by a filename that the compiler generates followed by its corresponding file, separated by white-spaces. The map file must contain all files that would be visited by the compiler. If a file not in the map file is needed, it causes an error.