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.
Building a static XLL against 0.19.0 fails to link with six unresolved
externals, because
xlOilHelpers.libis never produced in the staticoutput folders.
In
xlOil.sln, thexlOilHelpersproject defines onlyDebugandReleaseconfigurations — there is noDebugStaticorReleaseStatic.The other static-link projects (
xlOil-COM,xlOil-Dynamic,xlOil-Funcs,xlOil-XLL) all have them. So building the solution underReleaseStaticproduces those four libs but notxlOilHelpers.lib, eventhough
xlOil-XLLandxlOil-COMdepend 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
ReleaseStaticconfiguration toxlOilHelperscopied fromRelease(andDebugStaticfromDebug),tick Build, and build the project. The output directory is inherited via
$(Configuration), so the lib lands in the correct folder with no furtherchanges.
Environment
(
XllEntryPoint.h+XLO_DECLARE_ADDIN)Also possibly worth noting
xlOilStaticLib.propsaddsOleacc.lib, but a project that sets itslinker inputs manually rather than via the property sheet will hit an
unresolved
AccessibleObjectFromWindowfromxlOil-COM.lib(Connect.obj).Not a bug — just noting it in case it's useful for the docs.