[Freeswitch-dev] ESL Ruby/Lua extensions build/linking error

Philip.Pirozhkov at ontarget-group.com Philip.Pirozhkov at ontarget-group.com
Mon Apr 9 21:58:26 MSD 2012


Hi all,

Trying to build ruby and lua extensions from freeswitch/libs/esl:
lua]$ make
g++    -Wno-unused-function -c esl_wrap.cpp -o esl_wrap.o
esl_wrap.cpp:1510:17: fatal error: esl.h: No such file or directory
compilation terminated.
make: *** [esl_wrap.o] Error 1

this can be fixed adding
-I../src/include to esl_wrap.o task

but has ld error then:
lua]$ make
g++    -Wno-unused-function -I../src/include -c esl_wrap.cpp -o esl_wrap.o
g++  esl_wrap.o  -llua -lpthread -o ESL.so -L.
/usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
esl_wrap.o: In function `_wrap_new_ESLevent__SWIG_0':
esl_wrap.cpp:(.text+0x3974): undefined reference to  
`ESLevent::ESLevent(char const*, char const*)'
esl_wrap.o: In function `_wrap_new_ESLevent__SWIG_1':
... (tl;dr)


Same with ruby (even worse), it was failing to find ruby.h and  
ruby/config.h. I got make esl_wrap.cpp task fixed  
http://pastebin.com/uKFBZVF3

but there's an ld error again:

$ make
g++  esl_wrap.o  -lpthread -lrt -ldl -lcrypt -lm   -L.  -rdynamic  
-Wl,-export-dynamic -o ESL.so -L.
/usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
esl_wrap.o: In function `rb_class_of':
esl_wrap.cpp:(.text+0x9ed): undefined reference to `rb_cFixnum'
esl_wrap.cpp:(.text+0x9fa): undefined reference to `rb_cTrueClass'

Anyone successful with this stuff?
I'm not experienced with GCC stuff at all.
It would be very nice to pack this Ruby ESL to a gem (ruby package manager).

BR, Phil



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list