Fix two Linux build failures: shared StealthLink library and unused vtkImageViewer2 include - #1292
Open
mkomaiha wants to merge 2 commits into
Open
Fix two Linux build failures: shared StealthLink library and unused vtkImageViewer2 include#1292mkomaiha wants to merge 2 commits into
mkomaiha wants to merge 2 commits into
Conversation
On Linux PlusDataCollection linked libStealthLink.a. The static archive carries none of the SDK's own dependencies, so the boost symbols it references are left unresolved and linking PlusLib fails with: undefined reference to `boost::system::system_category()' undefined reference to `boost::system::generic_category()' libStealthLink.so records those as DT_NEEDED, so linking the shared library instead resolves them without having to enumerate the SDK's bundled boost by hand. Also install the shared library alongside the executables, matching what the WIN32 branch already does. Since both branches install the same file it is hoisted out of the platform conditional.
ViewSequenceFile.cxx includes vtkImageViewer2.h but never uses vtkImageViewer2; the include line is the only occurrence of the name in the file, and it is the only occurrence in the file's entire history. It is also the only thing in the target that reaches into VTK's InteractionImage module, which ViewSequenceFile does not link, so it compiles only when that module's include directory happens to arrive transitively. Where it does not, the build fails with: ViewSequenceFile.cxx:17:10: fatal error: vtkImageViewer2.h: No such file or directory Removing the include drops the undeclared dependency rather than linking a module whose symbols are never referenced.
mkomaiha
force-pushed
the
linux-stealthlink-build-fixes
branch
from
August 26, 2026 21:21
5bfeec4 to
a521b8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent build fixes found while building PlusLib with
PLUS_USE_STEALTHLINK=ONon Linux. They are in separate commits and touch different parts ofsrc/PlusDataCollection/CMakeLists.txt, so either can be cherry-picked on its own.1. Link the shared StealthLink library on Linux —
BUG:commitAddresses part of #957.
On Linux
PlusDataCollectionlinkedlibStealthLink.a. A static archive records no dependencies of its own, so the boost symbols the SDK references are never resolved and linking PlusLib fails:The SDK ships its own boost 1.49 beside the library, but nothing tells the linker to pull it in.
libStealthLink.sorecords them asDT_NEEDED:so linking the shared library resolves them without enumerating the bundled boost in CMake and hardcoding versions that would go stale with the next SDK drop.
The shared library is also added to
External_Libraries_Install, matching what theWIN32branch already did. Both platforms now install the same file, so that call is hoisted out of the conditional and only the genuinely platform-specific part — which library to link, plus the Windows-only debug variant — stays inside it.This does not close #957 by itself. The remaining errors in that issue are ABI mismatches (
std::__cxx11::basic_stringvsstd::string) caused by-D_GLIBCXX_USE_CXX11_ABI=0not reaching the external projects. The SDK is built against the pre-GCC5 libstdc++ ABI, and VTK, ITK, IGSIO and OpenIGTLink all have to agree with it. That fix belongs in PlusBuild and is filed separately; this change is independent of it and correct on its own.2. Remove unused vtkImageViewer2 include from ViewSequenceFile —
COMP:commitUnrelated to StealthLink; it just happens to block the same build.
Tools/ViewSequenceFile.cxxincludesvtkImageViewer2.hbut never usesvtkImageViewer2. The include is the only mention of the name in the file, and always has been — no commit in the file's history has ever referenced the type. The tool builds its display fromvtkImageActor,vtkRendererandvtkRenderWindowinstead.The header belongs to VTK's
InteractionImagemodule, whichViewSequenceFiledoes not link, so the include only resolves if that module's include directory happens to arrive through some other VTK target. When it doesn't, the build fails:This shows up with VTK 9.1.0 used from a build tree, where include directories come only from the modules actually linked.
Deleting the include is the fix. Linking
InteractionImagewould also make it compile, but the binary references no symbol from that module —--as-neededdrops it right back out, and the executable is byte-for-byte identical either way.For contrast, the 14 files that genuinely use this class (all under
Testing/) include it, declare avtkImageViewer2*, and construct one — andTesting/CMakeLists.txtlinksInteractionImagefor exactly those targets.ViewSequenceFilehas only the include.Testing
Ubuntu 21.04, GCC 10, VTK 9.1.0 and ITK 5.4.4 from a PlusBuild superbuild, StealthLink SDK 2.4,
PLUSBUILD_BUILD_PlusLib_TOOLS=ON.Each failure reproduces without its commit, and each commit was verified on its own. With both applied the build completes and the device is available at runtime:
(The StealthLink half additionally requires the PlusBuild ABI fix mentioned above to reach a successful link.)