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

Resolve windows name conflict #415

Merged
merged 1 commit into from
Jun 24, 2018
Merged

Resolve windows name conflict #415

merged 1 commit into from
Jun 24, 2018

Conversation

sgbihu
Copy link
Contributor

@sgbihu sgbihu commented May 21, 2018

  1. The windows dll will output the lib and dll, and rename the static
    lib will have conflict on windows.
  2. Delete rename code to dismiss the conflict.

1. The windows dll will output the lib and dll, and rename the static
    lib will have conflict on windows.
2. Delete rename code to dismiss the conflict.
@hawicz
Copy link
Member

hawicz commented May 23, 2018

How is it a conflict if one is called json-c.lib and the other json-c.dll?

@hawicz
Copy link
Member

hawicz commented Jun 15, 2018

Though I hate to close this without really understanding what you think the problem is, this doesn't seem to be a useful change to make, so I'm closing this without merging it.

@hawicz hawicz closed this Jun 15, 2018
@sgbihu
Copy link
Contributor Author

sgbihu commented Jun 18, 2018

I'm sorry to reply you so late.

In shared library VS project, it generate two file for user, one is json-c.lib, another is json-c.dll. The lib is for link, and dll for execute.

So the project will build both static and shared library. The static configuration will output json-c.lib and that lib will be overwritten by shared configuration. Eventually, it will only generate shared build.

Thanks.

@hawicz
Copy link
Member

hawicz commented Jun 24, 2018

I poked around a bit, and found a few things that explain a bit what the problem with windows linking is, e.g.:
https://blogs.msdn.microsoft.com/oldnewthing/20091013-00/?p=16403
https://stackoverflow.com/questions/6421693/why-are-lib-files-beasts-of-such-a-duplicitous-nature

Basically, windows leaves the information you need to actually link against a dll out of it, but puts it in a .lib file that is called an "import library". Then, it re-uses the same .lib extension for that import library and for static libraries, so if you want your static and dynamic libraries to have the same name you're SOL. Argh!

Anyway, it looks like the change you propose is a necessary and reasonable fix.

@hawicz hawicz reopened this Jun 24, 2018
@hawicz hawicz merged commit a056893 into json-c:master Jun 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants