Skip to content
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

Windows: Static libraries should end with .lib not .a when using the MSVC ABI install #29508

Closed
pjmlp opened this issue Nov 1, 2015 · 3 comments
Labels
O-windows Operating system: Windows

Comments

@pjmlp
Copy link

pjmlp commented Nov 1, 2015

The standard extension for Windows static libraries is .lib.

By keeping the .a extension while using the MSVC ABI, we are forced to rename the files when integrating Rust libraries into compiler chains that expect .lib as an extension.

Reopening the bug here as suggested by alexcrichton (rust-lang/cargo#2100)

@nagisa
Copy link
Member

nagisa commented Nov 1, 2015

Duplicateish of #28025. Maybe reopen that instead, since it has more discussion?

@retep998
Copy link
Member

retep998 commented Nov 1, 2015

rustc foo.rs --crate-type=staticlib produces libfoo.a.
This needs to be changed to produce foo.lib for -msvc.

@retep998
Copy link
Member

retep998 commented Nov 1, 2015

Actually, since that would conflict with the import library produced by --crate-type=dylib I propose using libfoo.lib instead for staticlib as it matches the conventions that Microsoft uses to distinguish static/dynamic libraries (such as ucrt.lib vs libucrt.lib)

@apasel422 apasel422 added the O-windows Operating system: Windows label Nov 2, 2015
retep998 added a commit to retep998/rust that referenced this issue Jan 16, 2016
libfoo.a -> foo.lib
In order to not cause conflicts, changes the DLL import library name
foo.lib -> foo.dll.lib

Fixes rust-lang#29508

Because this changes output filenames this is a [breaking-change]

Signed-off-by: Peter Atashian <retep998@gmail.com>
bors added a commit that referenced this issue Jan 21, 2016
I'm not sure if this was the best way to go about it, but it seems to work.

Fixes #29508

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

4 participants