-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking a simple swift program with a static library dependency fails. #249
Comments
I have traced down the issue to the fact that we are creating the static library with a prefix of lib which is not how libraries are named in windows. Using clang as the linker the -L Library is translated to a linker argument of "Library.lib"
The fix is to set the EXECUTABLE_PREFIX to empty on the windows platform for static libraries. Patch coming up shortly. |
Windows linking is failing to find a dependent static library. When using the clang driver for linking a '-l Library' will be translated into an arguemnt of 'Library.lib'. The linker is unable to find 'Library.lib'as the static library is named 'libLibrary.lib' * Remove the EXECUTABLE_PREFIX for static libraries on the windows platform. * Update the tests to not check for the link failures.
Windows linking is failing to find a dependent static library. When using the clang driver for linking a '-l Library' will be translated into an arguemnt of 'Library.lib'. The linker is unable to find 'Library.lib'as the static library is named 'libLibrary.lib' * Remove the EXECUTABLE_PREFIX for static libraries on the windows platform. * Update the tests to not check for the link failures.
On windows a simple command link tool, that has a dependency on a static library fails to link.
LinkerTests.alternateLinkerSelection exposes this error and has to expect the error.
During the "Ld" task the linker fails to find the shared library.
LNK1181: cannot open input file 'Library.lib'
To reproduce
swift test --filter alternateLink
The text was updated successfully, but these errors were encountered: