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

Fix the compilation issue on the Windows platform. #1200

Closed

Conversation

CapricornFBQ
Copy link

@CapricornFBQ CapricornFBQ commented Jun 3, 2024

  1. Fix the compilation issue on the Windows platform by include parts of the standard library.
  2. Fix the issue where exporting the "defaultClockRate" static variable in datachannel.lib/dll fails on the Windows platform.

@paullouisageneau
Copy link
Owner

Please don't change submodules, currently the build is broken as a result.

The library builds fine with MSVC, what is your setup?

  1. Fix the issue where exporting the "defaultClockRate" static variable in datachannel.lib/dll fails on the Windows platform.

What is the problem exactly and why would Windows require special treatment? Static variables must be inline, otherwise it's just a declaration and there must be a definition outside the class, that's why you hit "undefined reference" errors at first.

@CapricornFBQ
Copy link
Author

CapricornFBQ commented Jun 11, 2024

I apologize for not providing the context for the issue initially. I am using Visual Studio 2017 with SDK version 10.0.17763.0 and compiler version 19.16.27051. When I compile examples/streamer, there is an issue where defaultClockRate is not defined. After troubleshooting, I found that the ”datachannel.dll“ did not export this variable. It appears that on the Windows platform, there is a conflict when using inline and __declspec(dllexport) together.

@paullouisageneau
Copy link
Owner

paullouisageneau commented Jun 14, 2024

I'd be OK to fix the includes but the issue with inline and __declspec(dllexport) seems to be an issue with Visual Studio 2017. Again, the library builds fine on Windows with Visual Studio 2022 and MSVC 19.39.33523.0. Have you tried with a more recent version?

@paullouisageneau
Copy link
Owner

Closing in favor of #1280

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