saravnandm / pjsip2.5-g729codec

g729 codec integration with pjsip 2.5
19 stars 7 forks source link

linking error in xcode for i386 #1

Closed kavinchauhan closed 8 years ago

kavinchauhan commented 8 years ago

Hi saravanandm, You are a genius!!! this is really helpful to me for integrate g729 in pjsip2.5. I am just stuck somewhere with xcode build. I have successfully merge patch and files in pjsip2.5 and also make successful. but when I build project in xcode for simulator with iphone4s. it's shown build failed and giving some linker errors attached here. pjsip

meghaParmar commented 8 years ago

@saravanandm , Thank you so much for your help. Here is one step where I got error after building using make

These are the steps I am following:

  1. Unzip downloaded pjsip folder
  2. Edited Persmission using chmod -R 777 /pjproject-2.5
  3. Applied all patches in "/pjproject-2.5/build.mak.in", "/pjproject-2.5/pjmedia/build/Makefile", "/pjproject-2.5/pjmedia/include/pjmedia-codec.h", "/pjproject-2.5/pjmedia/src/pjmedia-codec/audio_codecs.c", "/pjproject-2.5/third_party/build/Makefile" and "config_site.h"
  4. Build "configure-iphone" file
  5. Build using "make dep", "make clean" and "make"
  6. After successful completion of make command, tried to build xcode project and it shows this error. untitled

    I have compiled pjsip library for archietecture i386. After completion of make command, under /pjsip2.5/third_party/build/bcg729, "output" folder also created with .o files

saravnandm commented 8 years ago

I can able to built it for iOS 9.2 simulator. By following the below steps.

  1. Go to pjproject-2.5 dir
  2. Then execute the cmds one by one.
    • export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
    • ARCH="-arch i386" CFLAGS="-O2 -m32 -mios-simulator-version-min=9.2" LDFLAGS="-O2 -m32 -mios-simulator-version-min=9.2" ./configure-iphone
    • make dep && make clean && make

if you still get the same error clean and try again.

NOTE: Make sure your selected xcode path is same as DEVPATH. To check selected xcode path xcode-select -p

To switch xcode path sudo xcode-select -switch /Applications/Xcode.app/Contents/Develo

meghaParmar commented 8 years ago

@saravanandm , I tried these commands. After "./configure-iphone" , It shows me this kind of error: aconfigure: error: C compiler cannot create executables

meghaParmar commented 8 years ago

@saravanandm ,

I again tried your solution after restarting mac terminal,

  1. Output of xcode-select -p := /Applications/Xcode.app/Contents/Developer
  2. Followed export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
  3. ARCH="-arch i386" CFLAGS="-O2 -m32 -mios-simulator-version-min=9.2" LDFLAGS="-O2 -m32 -mios-simulator-version-min=9.2" ./configure-iphone worked fine
  4. make dep && make clean && make also worked without error
  5. Tried to run application in xCode
saravnandm commented 8 years ago

That's good to hear!

ludivinefafournoux commented 5 years ago

Hello @saravnandm , I have the same problem. I tried everything and i have the problem with all architectures (armv7, i386, arm64) i'm using xcode 9.4.1, swift 4, and pjsip 2.8 with the 2.5 patch.

VinodComlink commented 5 years ago

Hi @saravnandm I am trying the solution but getting below compilation issues -

Undefined symbols for architecture i386: "_pjmedia_codec_bcg729_init", referenced from: _pjmedia_codec_register_audio_codecs in libpjmedia-codec-i386-apple-darwin_ios.a(audio_codecs.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [../bin/pjsua2-test-i386-apple-darwin_ios] Error 1 make[1]: [pjsua2-test-i386-apple-darwin_ios] Error 2 make: *** [all] Error 1

Could you please help in this?

saravnandm commented 5 years ago

The patch will work on pjsip2.5 and below for sure. Will start for pjsip2.8 soon. Could you please clean and build it again?

VinodComlink commented 5 years ago

I have tried everything. That is good to hear that you are about to start for 2.8. Could you please let me know if possible, when you are planning for 2.8

I highly appreciate !! Thanks

VinodComlink commented 4 years ago

@saravnandm saravnandm have you done with PJSIP 2.8?