Skip to content

xlOilHelpers has no DebugStatic/ReleaseStatic configuration, breaking static XLL builds #162

Description

@nburgessx

Building a static XLL against 0.19.0 fails to link with six unresolved
externals, because xlOilHelpers.lib is never produced in the static
output folders.

In xlOil.sln, the xlOilHelpers project defines only Debug and
Release configurations — there is no DebugStatic or ReleaseStatic.
The other static-link projects (xlOil-COM, xlOil-Dynamic,
xlOil-Funcs, xlOil-XLL) all have them. So building the solution under
ReleaseStatic produces those four libs but not xlOilHelpers.lib, even
though xlOil-XLL and xlOil-COM depend on its symbols.

Errors

Linking a static XLL against build\x64\ReleaseStatic:

xlOil-XLL.lib(Throw.obj) : error LNK2001: unresolved external symbol
"...xloil::Helpers::writeWindowsError(void)"
xlOil-XLL.lib(Intellisense.obj) : error LNK2001: unresolved external symbol
"...xloil::getEnvironmentVar(wchar_t const *)"
xlOil-XLL.lib(Intellisense.obj) : error LNK2001: unresolved external symbol
"...xloil::stableGuidFromString(...)"
xlOil-XLL.lib(Intellisense.obj) : error LNK2001: unresolved external symbol
"...xloil::guidToWString(...)"
xlOil-COM.lib(WorkbookScopeFunctions.obj) : error LNK2001: unresolved external symbol
"...xloil::getWindowsRegistryValue(...)"

Workaround

In Configuration Manager, add a ReleaseStatic configuration to
xlOilHelpers copied from Release (and DebugStatic from Debug),
tick Build, and build the project. The output directory is inherited via
$(Configuration), so the lib lands in the correct folder with no further
changes.

Environment

  • xlOil 0.19.0, built from source
  • Visual Studio 2022, toolset v143, x64
  • Consumer project follows the static XLL route
    (XllEntryPoint.h + XLO_DECLARE_ADDIN)

Also possibly worth noting

xlOilStaticLib.props adds Oleacc.lib, but a project that sets its
linker inputs manually rather than via the property sheet will hit an
unresolved AccessibleObjectFromWindow from xlOil-COM.lib(Connect.obj).
Not a bug — just noting it in case it's useful for the docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions