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 MSVC with shared libraries #26

Open
xxxcucus opened this issue Mar 6, 2021 · 6 comments
Open

Windows MSVC with shared libraries #26

xxxcucus opened this issue Mar 6, 2021 · 6 comments

Comments

@xxxcucus
Copy link

xxxcucus commented Mar 6, 2021

In Windows with Visual Studio 2019, BUILD_SHARED_LIBS option active, I receive an error when compiling because bcrypt.lib is not created. This impedes using the library in larger projects where the library should be built as shared library.

@trusch
Copy link
Owner

trusch commented Mar 6, 2021

Given the fact that this is a library consisting of one .hpp and four .c files, could you provide a PR for the build process to do this?

@trusch
Copy link
Owner

trusch commented Mar 6, 2021

I just merged a PR with support for visual studio 2019. Could you try again?

@xxxcucus
Copy link
Author

xxxcucus commented Mar 6, 2021

Now it generates bcrypt.lib but when I look in the project properties I see that the library is generated as static library. Moreover I would like to generate the project myself only from the CMakeLists.txt file. At them moment when generating project from CMakeLists.txt it does not create bcrypt.lib (with BUILD_SHARED_LIBS flag)

I have tried to generate the .lib file myself but have still not found a solution.

@xxxcucus
Copy link
Author

xxxcucus commented Mar 6, 2021

What is the role of the .S file there ? I think that without it I can manage to generate .lib for shared library with MSVC.

@xxxcucus
Copy link
Author

xxxcucus commented Mar 7, 2021

The file seems to be used only for i386 architecture. For my needs (x86_64) I can ignore it and try to do without it. I will let you know how that worked.

@xxxcucus
Copy link
Author

I would suggest adding a cmake variable for compiling the i386 version. When the flag is not active one could active the export of all simbol for windows. This will allow compiling as shared library with Msvc. For the remaining case I do not know. Maybe some one has an idea.

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

No branches or pull requests

2 participants