librtcdcpp icon indicating copy to clipboard operation
librtcdcpp copied to clipboard

Working mac build

Open chadnickbok opened this issue 8 years ago • 11 comments

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

chadnickbok avatar Aug 16 '16 21:08 chadnickbok

Initial CMakeLists.txt should now support Mac Os

chadnickbok avatar Sep 08 '16 22:09 chadnickbok

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 [email protected] from official release page.

And then running

> cmake MakeLists.txt
> make

dignifiedquire avatar Feb 06 '17 22:02 dignifiedquire

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

dignifiedquire avatar Feb 06 '17 22:02 dignifiedquire

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)?

gegles avatar Feb 06 '17 23:02 gegles

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

dignifiedquire avatar Feb 06 '17 23:02 dignifiedquire

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

dignifiedquire avatar Feb 06 '17 23:02 dignifiedquire

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.

chadnickbok avatar Feb 07 '17 01:02 chadnickbok

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

dignifiedquire avatar Feb 07 '17 10:02 dignifiedquire

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 :(

chadnickbok avatar Feb 07 '17 18:02 chadnickbok

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.

dignifiedquire avatar Feb 07 '17 19:02 dignifiedquire

That sounds awesome :)

chadnickbok avatar Feb 07 '17 21:02 chadnickbok