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

Same name for static and shared libraries #110

Open
davidbrochart opened this issue Dec 12, 2020 · 10 comments · May be fixed by #111
Open

Same name for static and shared libraries #110

davidbrochart opened this issue Dec 12, 2020 · 10 comments · May be fixed by #111
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@davidbrochart
Copy link

Would it be possible to have a different name for the static and the shared libraries?
We are having an issue when packaging azure-storage-cpplite for conda-forge on Windows (see conda-forge/staged-recipes#13417).

@katmsft
Copy link
Member

katmsft commented Dec 14, 2020

conda-forge/staged-recipes#13417 (comment)

Copying relevant comments for more info:

When you build a shared library for xxx on Windows, two files are generated: xxx.dll, which contains the code to execute, and xxx.lib which contains the exported symbols, use to link with.
The issue is that if you build a static library for xxx with the default options, you also generate a xxx.lib (not the same content as the previous one, but the same name and same location). If you install both shared and static packages, the latter.lib file overwirtes the former. Therefore, you need to use different names for static and share libraries.
Besides, applications linking with a static library should use the same runtime as that of the static library. It is therefore a common pattern to specify the runtime of the static library in its name.

@katmsft
Copy link
Member

katmsft commented Dec 14, 2020

Personally, I don't think it is a huge problem to change static libraries to have other names, however, could you point us to a sample project that's using different names for static/dynamic libraries? Also, is there a universally adapted pattern for dynamic/static library names?

@davidbrochart
Copy link
Author

Maybe @JohanMabille knows more about the name pattern?

@JohanMabille
Copy link

There is no single stadard naming convention; one I often see is libname-mt-s-version.lib or libname-mt-s.lib (here the mt part means multi-threaded, opposed to md used for building DLL, s means static linking).

@katmsft
Copy link
Member

katmsft commented Dec 15, 2020

@Jinming-Hu I don't have a problem with this. What do you think.

@katmsft katmsft self-assigned this Dec 15, 2020
@katmsft katmsft added enhancement New feature or request good first issue Good for newcomers labels Dec 15, 2020
@Jinming-Hu
Copy link
Member

Fine by me.

@katmsft
Copy link
Member

katmsft commented Dec 15, 2020

BTW, if we do that, how would it change the way customers consume the static library? They have to explicitly import libname-s.lib instead?

@davidbrochart
Copy link
Author

I think so, yes.

@JohanMabille
Copy link

They have to explicitly import libname-s.lib instead?

Yes

@katmsft
Copy link
Member

katmsft commented Dec 20, 2020

We welcome community contribution on this, the name should be azure-storage-lite-s.lib given the dynamic linking library's name is azure-storage-lite.lib

@davidbrochart davidbrochart linked a pull request Dec 21, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants