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

libwebrtc-magic.a equivalent file for windows machine #57

Open
sbhushan87 opened this issue Jan 4, 2017 · 7 comments
Open

libwebrtc-magic.a equivalent file for windows machine #57

sbhushan87 opened this issue Jan 4, 2017 · 7 comments

Comments

@sbhushan87
Copy link

Hi,

I am trying to use this library on windows machine. I followed steps mentioned in another issue to create build.sh (build.bat) for windows. I was able to complete all steps except

"mv libwebrtc-magic.a $LIB_DIR/libwebrtc-$OS-$ARCH-magic.a"

After compiling webrtc on windows, I couldn't find any file with name "libwebrtc-magic" in out folder. Can you please help me to find equivalent dll file for windows machine.

Thank you.

Regards,
Shashi

@sbhushan87
Copy link
Author

Hi,

I managed to create a static library for webrtc for windows machine. Then I created pc file for windows as you did for linux and mac. But now GO build is failing with attached error in screenshot.

cerror

Please let me know if i am missing anything ?

Regards,
Shashi

@keroserene
Copy link
Owner

Hi Shashi,

Great to see your progress here. I do recall missing symbols just like rtc::Thread in the past when initially figuring out how to build the static library for linux. This process really should be simpler than it is...

You're missing some part of the archive, whichever contains webrtc/base/thread.h, and possibly others. What steps did you take towards building your static library? Have you looked at the .GYP or .ninja files? It's been more than a year since I've touched any of this, but I recall sanity checking against the archives in obj/webrtc/peerconnection_client.ninja (If only I had a windows machine to look into this more -- but really glad you're close to figuring this out!)

Best,
~serene

@sbhushan87
Copy link
Author

Thanks for you reply Serene.

I followed steps mentioned on webrtc official website https://webrtc.org/native-code/development/
I compiled code using Gn and Ninja because GYP is no longer supported by chromium project and has been deprecated.

I checked my repos for webrtc and found all header files available there, so logically it should be part of static library that i am using. I saw in build.sh for go-webrtc, it checkouts specific webrtc version (f33698296719f956497d2dbff81b5080864a8804) , Is there any dependency or need for this version ?

I'm working on latest webrtc repo because I was not able to compile this specific version on windows machine. I will try to make this work as long time allows me and keep you updated. If you have any suggestion for me on this please let me know.

Regards,
Shashi

@arlolra
Copy link
Collaborator

arlolra commented Mar 14, 2017

@sbhushan87 the master branch is now up-to-date with branch-heads/58, so you should be good with gn now.

@dearcj
Copy link

dearcj commented May 3, 2017

@sbhushan87 Hi, have you succeed with running webrtc on windows? If so can you please share build.bat and .pc files?

@blizzardplus
Copy link

You can build the WebRTC source code using the same build.sh file with minor modifications. You need to make sure that you have Golang and Python in your PATH. The headers are extracted the same way. The only difference is that the library is linked as .lib file. There are webrtc.lib and webrtc_common.lib under out/Release/obj/webrtc. The only problem is that CGO in Windows currently uses Mingw and can't compile against libraries build with MSVC. There are a couple of possible solutions in progress. Using Clang in CGO Windows or support MSVC object files in CGO.

@gY1F1Rw2
Copy link

Here is blizzardplus's patch that allows building webrtc.lib and webrtc_common.lib (using the recommended MSVC 2015 build procedure for Chromium on Windows): build.sh.diff.txt.

But yeah, unfortunately we couldn't make the MSVC-compiled libraries work with go-webrtc and Cgo, despite trying many things. It comes down to an incompatibility between MSVC and MinGW (currently Cgo on Windows can only use MinGW).

Here's a sample of a linker error that you'll get.

C:\Users\user\chrome\go-webrtc\tmp.o: In function `main’:
C:/Users/user/chrome/go-webrtc/tmp.cc:7: undefined reference to `rtc::CopyOnWriteBuffer::CopyOnWriteBuffer(unsigned long long, unsigned long long)’
C:/Users/uesr/chrome/go-webrtc/tmp.cc:7: undefined reference to `rtc::CopyOnWriteBuffer::~CopyOnWriteBuffer()’
collect2.exe: error: ld returned 1 exit status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants