-
Notifications
You must be signed in to change notification settings - Fork 172
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 build adjustment #716
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot :)
Could you please explain what you changed, and if possible split code changes and build system changes.
In general, the windows build works fine, but only for static opendht target. When I try to build dynamyc library and link it with the tool's executables, I got the compilation error first
This is solved by adding
Problems with
The rest errors occur due to incorrect export of static members
|
In general, it seems that the code needs to be refactored for class export policy. Many of them don't need to be exported, because are fully defined in header files. By the way, the cause of some linking errors is not wrong export as I thought first, but import attribute is incorrect when linking dll library. Below is another way to fix windows dynamic build |
It seems that the changes are more correct now. API preserves backward compatibility. But, in my opinion, the export of classes still needs to be revised. |
Apart from the cmake script adjustment, there are some minor code changes to fix dll export.
Steps to build opendht with Visual Studio 17 2022.