Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 12-04-2015, 07:27 AM
xanadu6291 xanadu6291 is offline
Junior Member
 
Join Date: Dec 2015
Posts: 9
xanadu6291 is on a distinguished road
Default

rtmpdump build problem on Mac OS X using GnuTLS


Hello,

I'm now trying to build rtmpdump under Mac OS X 10.11.1 El Capitan / Xcode 7.1.1 but yet not succeeded.

I'm trying to use GnuTLS for crypto and I'm now thinking this might be succeeded.

But in making rtmpdump, I get "ld: library not found for -lgnutls" error when executing "gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lgnutls -lhogweed -lnettle -lgmp -lz" portion.

My make command and log is as follows:

Code:
$ export TARGET ="/Users/roushi/Desktop/RTMPDump_Test"
$ make SYS=darwin CRYPTO=GNUTLS SHARED=no INC=-I${TARGET}/include

gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o rtmp.o rtmp.c
gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o log.o log.c
gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o amf.o amf.c
gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o hashswf.o hashswf.c
gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o parseurl.o parseurl.c
ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o
ar: creating archive librtmp.a
gcc -Wall  -I/Users/roushi/Desktop/RTMPDump_Test/include -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpdump.o rtmpdump.c
gcc -Wall  -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lgnutls -lhogweed -lnettle -lgmp -lz  
ld: library not found for -lgnutls
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rtmpdump] Error 1
I have to pass
Code:
INC=-I${TARGET}/include
to let rtmpdump to find out 'gnutls/gnutls.h'

I'd like to use GnuTLS because OS X no longer provide header file of OpenSSL.

Please help me!!
Reply With Quote
  #2  
Old 12-04-2015, 11:31 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: rtmpdump build problem on Mac OS X using GnuTLS


You should use XCFLAGS to pass the compiler options and XLDFLAGS to pass the linker options. Try adding the following to your make command and it may fix your problem.

Code:
XCFLAGS="-I/path/to/gnutls/headers" XLDFLAGS="-L/path/to/libgnutls.a
Reply With Quote
  #3  
Old 12-04-2015, 08:56 PM
xanadu6291 xanadu6291 is offline
Junior Member
 
Join Date: Dec 2015
Posts: 9
xanadu6291 is on a distinguished road
Default

Re: rtmpdump build problem on Mac OS X using GnuTLS


KSV-san, Thank you for reply!

I thought that XCFLAGS and XLDFLAGS should be directory. So I tried:

Code:
export TARGET ="/Users/roushi/Desktop/RTMPDump_Test"
make SYS=darwin CRYPTO=GNUTLS SHARED= XCFLAGS=-"I${TARGET}/include" XLDFLAGS="-L/${TARGET}/lib"
Then console outputs:
Code:
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o rtmp.o rtmp.c
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o log.o log.c
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o amf.o amf.c
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o hashswf.o hashswf.c
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_GNUTLS  -O2    -c -o parseurl.o parseurl.c
ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o
ar: creating archive librtmp.a
gcc -Wall -I/Users/roushi/Desktop/RTMPDump_Test/include  -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpdump.o rtmpdump.c
gcc -Wall -L//Users/roushi/Desktop/RTMPDump_Test/lib -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lgnutls -lhogweed -lnettle -lgmp -lz  
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      __gnutls_ucs2_to_utf8 in libgnutls.a(system.o)
  "_iconv_close", referenced from:
      __gnutls_ucs2_to_utf8 in libgnutls.a(system.o)
  "_iconv_open", referenced from:
      __gnutls_ucs2_to_utf8 in libgnutls.a(system.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rtmpdump] Error 1
Is this error mean I have any fault on building GnuTLS?
Reply With Quote
  #4  
Old 12-04-2015, 11:20 PM
xanadu6291 xanadu6291 is offline
Junior Member
 
Join Date: Dec 2015
Posts: 9
xanadu6291 is on a distinguished road
Smile

Re: rtmpdump build problem on Mac OS X using GnuTLS


I googled the word "_iconv", referenced from:" and found the answer. (This page is written in Japanese)

I added "-liconv" to XLDFLAGS. So make statement is:
Code:
make SYS=darwin CRYPTO=GNUTLS SHARED= XCFLAGS="-I${TARGET}/include" XLDFLAGS="-L/${TARGET}/lib -liconv"
With this addition, I have succeeded to build rtmpdump with GnuTLS finally!!

Install:
Code:
make install prefix=${TARGET} CRYPTO=GNUTLS SHARED=
Hopefully there are someone who teach me how to test rtmpdump with secure connection...

Last edited by xanadu6291 : 12-05-2015 at 03:02 AM. Reason: Correction of install statement
Reply With Quote
  #5  
Old 12-09-2015, 05:42 AM
xanadu6291 xanadu6291 is offline
Junior Member
 
Join Date: Dec 2015
Posts: 9
xanadu6291 is on a distinguished road
Smile

Re: rtmpdump build problem on Mac OS X using GnuTLS


Quote:
I added "-liconv" to XLDFLAGS. So make statement is:
Code:
make SYS=darwin CRYPTO=GNUTLS SHARED= XCFLAGS="-I${TARGET}/include" XLDFLAGS="-L/${TARGET}/lib -liconv"
If you link gnutls dynamically, you don't need to add "-liconv".
But even in this case, you need "SHARED=" to build rtmpdump correctly.
Reply With Quote
Reply Post New Thread
Tags: , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:27 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons