I am adding Windows to the CI of the TSDuck open source project. The project is written in C++ with about 300 kloc. The CI script compiles the project (several shared libraries and executable) and then run a few test procedures. This works fine with Linux and macOS.
On Windows, the build complete successfully. It uses MSBuild and Visual C++. The EXE and DLL are all present in the output directory. Seen here using “ls -l” in the script.
But when I run any of the generated EXE, the command fails because of a missing DLL. But I cannot see which one. See here the command and its output:
$ if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ls -l build/msvc/$BINDIR/tsversion.exe build/msvc/$BINDIR/tsduck.dll build/msvc/$BINDIR/tsversion.exe --version=all 2>&1 else source src/tstools/release-x86_64/setenv.sh && tsversion --version=all fi -rwxr-xr-x 1 travis 197121 5722112 Jan 8 14:16 build/msvc/Release-x64/tsduck.dll -rwxr-xr-x 1 travis 197121 120320 Jan 8 14:21 build/msvc/Release-x64/tsversion.exe C:/Users/travis/build/tsduck/tsduck/build/msvc/Release-x64/tsversion.exe: error while loading shared libraries: tsduck.dll: cannot open shared object file: No such file or directory
You can see that tsduck.dll is here, in the same directory as the executable. So, it must be another DLL but there is no clue about it.
- The build completes successfully, no library was missing at build time. Only some unknown DLL is missing at run time.
- Running the same build and run commands on my local system works.
- I have reproduced a small test project which builds an EXE and a DLL. The build and execution are fine on Travis-CI. So, building an EXE calling a DLL works on Travis. This was expected but I wanted to be sure.
- In the same test project, I added a directory containing the tsversion.exe and tsduck.dll that I built locally on my system and try to run them on Travis-CI. I get the same missing DLL error.
- The TSDuck EXE and DLL reference a larger number of Windows system DLL’s than a basic “hello world” test but it does not use any third-party DLL. Only Windows DLL’s. And remember that the build completes without error.
Does anyone have an idea on how to troubleshoot this one? How can we figure out which DLL is missing? Why does the execution fail on Travis-CI while it builds successfully?
Thanks for your help.