C++ Linker Warnings

From RAD Studio
Jump to: navigation, search

Go Up to C++ Linker


Project > Options > C++ Linker > Warnings

Use this dialog box to set C++ linker warning options.

Options Description

Target, Apply, Save

See Target Options.

Common items

See Common Items on Project Options Pages.

Note: The Warnings page only supports Technical Details About ILINK32 and ILINK64 (32-bit Windows), Technical Details About ILINK32 and ILINK64 (64-bit Windows) and XLINK (OS X).
Option Description

Disable all warnings
(-w-)

Disables all warning and error messages. Default = False

Enable all warnings
(-w)

Displays all warning and error messages. Default = False

Selected warnings

Enables only the specific warnings that are set to True. Click the + to display the list of ILINK32 warnings. Default = True.

Option Default Description Switch

Attempt to export non-public symbol

On

A symbol name was listed in the EXPORTS section of the module definition file, but no symbol of this name was found as public in the modules linked.

Possible causes are:

  • You are trying to export a function that is not declared as public.
  • You specified the _export keyword in the declaration of a function but not in its definition, or the other way around.
  • You made a mistake in spelling or case.
  • You are exporting a procedure that is declared but not defined.
  • If you are using case-sensitive exports, the Pascal calling convention used by Windows requires these symbols to be all-uppercase characters.

-wexp

Creating a package without any units

On

You are attempting to create a package that contains no units. Check the Contains list to be sure the associated units are listed. (The Contains list identifies the unit files to be bound into the package.)

-wnou

Image linked as an executable, but with a .DLL extension

On

The linker generates this warning when an executable file has been generated and stored in a file with a .DLL or .BPL extension. This usually occurs when you intended to build a .DLL or .BPL but forgot to specify a .DLL or .BPL target.

The complete warning message is:

Image linked as an executable, but with .DLL or .BPL extension

-wdee

Public symbol defined in more than one library

Off

This warning is displayed if you have duplicate symbols in two separate libraries.

There is special handling for -wdup and -wdpl. -wdup can be considered the master control for warnings about duplicate publics. If this warning is disabled, no message about duplicate publics is emitted. -wdpl controls whether or not warnings are emitted for duplicate publics that are being linked from library modules. If -wdpl is disabled, and -wdup is enabled, only warnings for duplicate publics from OBJ files on the linker command line are emitted. If -wdpl and -wdup are both enabled, the linker flags duplicate publics that are in modules being linked from LIB files.

Currently, -wdpl is the only warning that is disabled by default. So specifying no warning options on the command line is the same as the following:

-w+exp -w+rty -w+dup -w-dpl -w+nou -w+srd -w+dee -w+dli -w+snf

The complete warning messages are:

Public symbol 'symbol' defined in both library module 'module1' and 'module2'
Public symbol 'symbol' defined in both module 'module1' and 'module2'

-wdup
-wdpl

Public symbol defined in more than one object file

On

Section not found

On

This warning occurs when a named section is not found.

The complete warning message is:

Section ‘section’ not found

-wsnf

Stripping relocations from a DLL may cause it to malfunction

On

This warning occurs if the Base address option is set when linking a DLL.

The complete warning message is:

Stripping relocations from a DLL may cause the DLL to malfunction

-wsrd

Unable to load DLL

On

This warning occurs if the Base address option is set when linking a DLL. In almost every case, this error will prevent the application from running.

-wuld

Unable to perform incremental link

On

This warning appears if the incremental link fails. The linker detected an error in one of its state files (projectname.IL*) so it started a full link and created a new set of state files.

The complete warning message is:

Unable to perform incremental link – performing full link

-wrty

See Also