Linking failure in Windows (works fine on Linux)
- Dominant language
- C++
- Stars
- 251
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
Having a `run` target that runs an `exe` target (https://github.com/djarek/beast/blob/azp/test/beast/core/Jamfile#L78) works fine on Linux, but fails on Windows because it attempts to link an executable without any object files:
https://dev.azure.com/damianjarek93/beast/_build/results?buildId=226&view=logs&jobId=7ce3e32e-914e-562e-6fa6-0c87f5911977&taskId=ef6812e9-593a-51df-a19f-70f65eb2c5be&lineStart=715&lineEnd=716&colStart=1&colEnd=1
```msvc.link bin.v2\libs\beast\test\beast\zlib\run-fat-tests.test\msvc-14.1\debug\address-model-64\cxxstd-17-iso\threadapi-win32\threading-multi\run-fat-tests.exe
LINK : warning LNK4001: no object files specified; libraries used
LINK : error LNK2001: unresolved external symbol mainCRTStartup
bin.v2\libs\beast\test\beast\zlib\run-fat-tests.test\msvc-14.1\debug\address-model-64\cxxstd-17-iso\threadapi-win32\threading-multi\run-fat-tests.exe : fatal error LNK1120: 1 unresolved externals
```
Contributor guide
Research direction
Start with test/beast/core/Jamfile at the referenced run target around line 78, then compare how the run and exe targets are assembled on Windows and Linux. Reproduce the MSVC link command from the linked build log; done means the Windows run-fat-tests.exe links successfully without regressing the Linux build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100