chadnickbok / librtcdcpp

A simple WebRTC DataChannels library
BSD 3-Clause "New" or "Revised" License
158 stars 41 forks source link

Working mac build #2

Open chadnickbok opened 8 years ago

chadnickbok commented 8 years ago

This should be easy, but unfortunately I can't figure out why the library isn't currently connecting to browsers on Mac OS

chadnickbok commented 8 years ago

Initial CMakeLists.txt should now support Mac Os

dignifiedquire commented 7 years ago

Got things working from homebrew on the latest macOS, with

> brew install log4cxx openssl libusrsctp cmake

adding the following config to profile config

export OPENSSL_INCLUDE_DIR="$(brew --prefix openssl)/include"
export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib"
export OPENSSL_ROOT_DIR="$(brew --prefix openssl)"

export USRSCTP_LIBRARY="$(brew --prefix libusrsctp)/lib"
export USRSCTP_INCLUDE_DIR="$(brew --prefix libusrsctp)/include"

Install libnice@0.1.13 from official release page.

And then running

> cmake MakeLists.txt
> make
dignifiedquire commented 7 years ago

What is not working though, is

> make install
make: *** No rule to make target `install'.  Stop.

and trying to run the example fails with

./websocket_client/testclient
dyld: Library not loaded: @rpath/librtcdcpp.dylib
  Referenced from: /Users/dignifiedquire/opensource/webrtc/librtcdcpp/examples/./websocket_client/testclient
  Reason: image not found
[1]    86993 abort      ./websocket_client/testclient
gegles commented 7 years ago

Yeah, we haven't yet tackled the install portion of the CMake build. I'll try to get to it. Feel free to contribute if you need it faster ;-).

As for the example, it should work (at least on Mac). Are you building the example via CMake (or the Makefile)?

dignifiedquire commented 7 years ago

I tried the make default target after generating it through cmake. As well as running make inside the examples/websocket_client.

dignifiedquire commented 7 years ago

This is the full log: https://gist.github.com/dignifiedquire/fc5d14562681c318a756b61e26fdff8d

chadnickbok commented 7 years ago

Thanks for the log - it looks like the example can't be built because it can't link against the newly-generated dylib. Weird!

Try building from a separate directory, like this:

mkdir build
cd build
cmake ..
make

Just to make sure that you're in a clean build directory with no conflicting files.

dignifiedquire commented 7 years ago

This worked: https://gist.github.com/dignifiedquire/8ff4a1edf108e2de5821663b5bf3b91f

chadnickbok commented 7 years ago

Okay, great - I'll take a look at why builds in the root aren't working, but for now it looks like you're ready to go!

Next up, take a look at the readme for the example: https://github.com/chadnickbok/librtcdcpp/tree/master/examples

This is still very much a work-in-progress; while the 'core' works, I pulled this library out of another project I was working on, and we still haven't finished working on getting a great set of demos together. Sorry for all the rough edges :(

dignifiedquire commented 7 years ago

No reason to be sorry, I'm super grateful for finding an implementation of webrtc datachannels that actually works and is not the chromium one.

I got the example to work with both current FF and Chrome as described. Just fyi my end, end goal is to get a crossplattform wrtcd implementation for rust + bindings to node.js and go. But for now I'm doing one step at a time, which is for now just creating a wrapper around this library and make it available from rust.

chadnickbok commented 7 years ago

That sounds awesome :)