baresip / baresip-ios

Baresip for iOS
47 stars 33 forks source link

dyld: Library not loaded: libre.dylib Reason: image not found #2

Closed AdilSoomro closed 9 years ago

AdilSoomro commented 11 years ago

I followed your guidelines and was able to make library.

I draged the resulted armv7 folder to my project and added single line in AppDelegate's didFinishLaunchingWithOptions method..

/* Initialise System library */
int err = libre_init();

when I command + click on this method, it reveals the method in ...armv7/include/re/re_main.h file.

I'm able to compile it. but when I run it crashes and shows following debug info in logs

dyld: Library not loaded: libre.dylib
Referenced from: /var/mobile/Applications/C43EE39E-9DAA-4F4D-9EF9-4A41A8A5BAED/my.app/my
Reason: image not found

Here is screenshot of my project's Linked Framework and Libraries section.:

Screen.png

Any insights to this problem will be much appreciated.

As I found this which said to make library optional didn't work out as when execution reaches on the above line of code, app crashes again.

AdilSoomro commented 11 years ago

Okay, I was adding armv7 libs instead of fat libs, now I added fat libs which are libbaresip.a, librem.a and libre.a but its producing such error:

Undefined symbols for architecture armv7:
  "_res_9_close", referenced from:
   _get_resolv_dns in libre.a(res.o)
  "_res_9_init", referenced from:
  _get_resolv_dns in libre.a(res.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
AdilSoomro commented 11 years ago

Solved it, it needed few native frameworks to be added. Now my Framework and Libraries section looks like this:

Screen shot 2012-12-13 at 8 22 41 PM

but it compiles for device only. works for me

alfredh commented 11 years ago

yes, thanks for publishing your solution

that is right, the libre+librem+libbaresip should be static .a libraries and other needed frameworks like libz, libresolv, Foundation etc. is used by libbaresip++ so it is needed.

Joa0S commented 11 years ago

Have you successfully create librem.a for armv7 ? I am getting an error (see ERROR Description) while a try to compile librem for armv7, can you help me? I removed every reference to amrv6 from contrib.mk and I had some stuff like:

ifeq ($(SDK_VER),) SDK_VER := $(shell [ -d $(ROOT_ARM)/SDKs/iPhoneOS6.1.sdk ] && echo "6.1") endif

in contrib.mk.

Now I am stuck in this error and I can't find a solution. Probably is missing some file after -L flag and I already searched and found a variable in the rem MakeFile on line 81:

@$(LD) $(LFLAGS) $(SH_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@

but now I don't know what to do...

ERROR Description:

CC /Users/10056836/Desktop/baresip-ios-master/build/armv7/librem/vid/fmt.o CC /Users/10056836/Desktop/baresip-ios-master/build/armv7/librem/vid/frame.o CC /Users/10056836/Desktop/baresip-ios-master/build/armv7/librem/vidconv/vconv.o LD librem.dylib ld: warning: directory not found for option '-L-lre' Undefined symbols for architecture armv7: "_list_append", referenced from: _aubuf_append in aubuf.o _aumix_source_enable in aumix.o _vidmix_source_enable in vidmix.o "_list_count", referenced from: _aumix_source_count in aumix.o "_list_flush", referenced from: _aubuf_flush in aubuf.o _aubuf_destructor in aubuf.o "_list_unlink", referenced from: _auframe_destructor in aubuf.o _aumix_source_enable in aumix.o _source_destructor in aumix.o _vidmix_source_enable in vidmix.o _source_destructor in vidmix.o "_lock_alloc", referenced from: _aubuf_alloc in aubuf.o "_lock_read_get", referenced from: _aubuf_cur_size in aubuf.o _aubuf_debug in aubuf.o "_lock_rel", referenced from: _aubuf_cur_size in aubuf.o _aubuf_debug in aubuf.o _aubuf_flush in aubuf.o _aubuf_read in aubuf.o _aubuf_get in aubuf.o _aubuf_append in aubuf.o "_lock_write_get", referenced from: _aubuf_flush in aubuf.o _aubuf_read in aubuf.o _aubuf_get in aubuf.o _aubuf_append in aubuf.o "_mbuf_alloc", referenced from: _aubuf_write in aubuf.o "_mbuf_read_mem", referenced from: _aubuf_read in aubuf.o "_mbuf_write_mem", referenced from: _aubuf_write in aubuf.o "_mbuf_write_u16", referenced from: _autone_sine in tone.o _autone_dtmf in tone.o "_mem_alloc", referenced from: _aumix_source_alloc in aumix.o _aumix_thread in aumix.o "_mem_deref", referenced from: _aubuf_alloc in aubuf.o _aubuf_read in aubuf.o _aubuf_destructor in aubuf.o _aubuf_append in aubuf.o _auframe_destructor in aubuf.o _aubuf_write in aubuf.o _aufile_open in aufile.o ... "_mem_ref", referenced from: _aubuf_append in aubuf.o _aumix_source_alloc in aumix.o _vidmix_source_alloc in vidmix.o "_mem_zalloc", referenced from: _aubuf_alloc in aubuf.o _aubuf_append in aubuf.o _aufile_open in aufile.o _auresamp_alloc in resamp.o _aumix_alloc in aumix.o _aumix_source_alloc in aumix.o _aumix_thread in aumix.o ... "_re_fprintf", referenced from: _wav_header_decode in wave.o "_re_hprintf", referenced from: _aubuf_debug in aubuf.o "_re_printf", referenced from: _vidframe_fill in frame.o _vidframe_init_buf in frame.o _vidconv in vconv.o "_sys_htoll", referenced from: _wav_header_encode in wave.o "_sys_htols", referenced from: _wav_header_encode in wave.o "_sys_ltohl", referenced from: _wav_header_decode in wave.o "_sys_ltohs", referenced from: _wav_header_decode in wave.o "_tmr_jiffies", referenced from: _aubuf_get in aubuf.o _aumix_thread in aumix.o _content_thread in vidmix.o _vidmix_thread in vidmix.o ld: symbol(s) not found for architecture armv7 collect2: ld returned 1 exit status make[1]: * [librem.dylib] Error 1 make: * [librem] Error 2

ramki1979 commented 11 years ago

@johnnyfama Have you solved your problem.

I had also the same problem today and I have solved it. If anyone have the same problem, just reply here..

Joa0S commented 11 years ago

No...

ramki1979 commented 11 years ago

@johnnyfama The problem is exactly at $(LIBRE_SO)

@$(LD) $(LFLAGS) $(SH_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@

check your $(DESTDIR) and $(LIBDIR) and replace $(LIBRE_SO) accordingly. I have repalced it with $(DESTDIR)$(LIBDIR)

I copied all my sources into /usr/local/sip/ when running make these are evaluated to $(DESTDIR) --> /usr/local/sip/contrib/armv7/ and (LIBDIR) --> lib

so in my case $(DESTDIR)$(LIBDIR) is /usr/local/sip/contrib/armv7/lib

Hope this helps..

Joa0S commented 11 years ago

I will try that, thank you ramki1979.

TamilRaja commented 11 years ago

Error : How to solve this error

Undefined symbols for architecture i386:

"_res_9_dn_expand", referenced from: eXosip_dnsutils_srv_lookup in libeXosip2.a(eXutils.o) _eXosip_dnsutils_naptr_lookup in libeXosip2.a(eXutils.o) "_res_9_init", referenced from: linphone_core_configure_resolver in liblinphone.a(misc.o) "_res_9_query", referenced from: __eXosip_dnsutils_srv_lookup in libeXosip2.a(eXutils.o) _eXosip_dnsutils_naptr_lookup in libeXosip2.a(eXutils.o) ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status

bhautik-ziniya commented 5 years ago

Solved it, it needed few native frameworks to be added. Now my Framework and Libraries section looks like this:

Screen shot 2012-12-13 at 8 22 41 PM

but it compiles for device only. works for me

Hi @AdilSoomro, I'm also getting the same error

dyld: Library not loaded: libre.dylib
  Referenced from: /var/containers/Bundle/Application/5C6A4D3A-7821-423A-885B-3822C0BC78DB/BaresipDemo_ManualLib.app/BaresipDemo_ManualLib
  Reason: image not found

I have added all the framework you have mention in the screenshot, what other framework you have added to solve the problem? can you please mention all the framework? or any other solve to this problem?

Here is screenshot of my project's Linked Framework and Libraries section:

image

lilkid3 commented 4 years ago

Hi @bhautik-ziniya Have you solved the problem ?

Solved it, it needed few native frameworks to be added. Now my Framework and Libraries section looks like this: Screen shot 2012-12-13 at 8 22 41 PM but it compiles for device only. works for me

Hi @AdilSoomro, I'm also getting the same error

dyld: Library not loaded: libre.dylib
  Referenced from: /var/containers/Bundle/Application/5C6A4D3A-7821-423A-885B-3822C0BC78DB/BaresipDemo_ManualLib.app/BaresipDemo_ManualLib
  Reason: image not found

I have added all the framework you have mention in the screenshot, what other framework you have added to solve the problem? can you please mention all the framework? or any other solve to this problem?

Here is screenshot of my project's Linked Framework and Libraries section:

image

AdilSoomro commented 4 years ago

We moved from baresip to another sip stack. So really sorry if I don't reply to your questions as I'm really out of context of baresip.

lilkid3 commented 4 years ago

We moved from baresip to another sip stack. So really sorry if I don't reply to your questions as I'm really out of context of baresip.

Thank you for your response.