iOS : Getting Linker error while integrating Photon-iOS-Sdk_v4-1-6-0 (Set Library and Header path)

phsojitraphsojitra
edited April 24 in Native
Error : ld: library not found for -lLoadBalancing-objc_Debug_iphoneos
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Set library path as per below :

"$(SRCROOT)/Photon-iOS-Sdk_v4-1-6-0/Common-cpp/lib"
"$(SRCROOT)/Photon-iOS-Sdk_v4-1-6-0/Photon-cpp/lib"
"$(SRCROOT)/Photon-iOS-Sdk_v4-1-6-0/LoadBalancing-cpp/lib"

Set Header Search path as per below :

"$(SRCROOT)/Photon-iOS-Sdk_v4-1-6-0"

Set Other Linker Flag as per below :

-lLoadBalancing-objc_$(CONFIGURATION)_$(PLATFORM_NAME)
-lPhoton-objc_$(CONFIGURATION)_$(PLATFORM_NAME)
-lCommon-objc_$(CONFIGURATION)_$(PLATFORM_NAME)

My Project structure as per below :

Desktop -> PhotonDemo -> PhotonDemo.xcodeproj
Desktop -> PhotonDemo -> Photon-iOS-Sdk_v4-1-6-0

Please provide me solution for linker error.

Comments

  • @phsojitra
    not a Photon problem. It's wrong project settings. Check full path to Photon libraries is set and correct (MUST be exist and accessible, You should check it).

    -lLoadBalancing-objc_Debug_iphoneos - this will search for libLoadBalancing-objc_Debug_iphoneos.a but correct file name is libLoadBalancing-cpp_debug_iphoneos.a. If Xcode is case sensitive, that may be cause of Your error.
  • P.S. in previous post I mean:
    libLoadBalancing-objc_Debug_iphoneos.a but correct file name is libLoadBalancing-objc_debug_iphoneos.a not cpp of course...
  • KaiserludiKaiserludi admin
    edited April 27
    Hi @phsojitra.

    As @Dmitry_Stepanushkin has already pointed out there is a problem with your project settings.

    Currently you are setting the library paths to (only) the C++ libraries, but the linker flags for (only) the objectiveC libraries.

    As of now it is unclear to me if you actually want to use the C++ or the objectiveC Client API.

    If you want to use the C++ libraries, then (the relevant paths of) your project settings should look like the ones of our C++ demos:
    Library search paths:
    
    ../../../Common-cpp/lib
    ../../../Photon-cpp/lib
    ../../../LoadBalancing-cpp/lib
    
    Header Search paths:
    
    ../../..
    ../../shared/inc
    
    Other Linker Flags:
    
    -lstdc++
    -force_load ../../../Common-cpp/lib/libCommon-cpp_$(CONFIGURATION)_$(PLATFORM_NAME).a
    -lCommon-cpp_$(CONFIGURATION)_$(PLATFORM_NAME)
    -lPhoton-cpp_$(CONFIGURATION)_$(PLATFORM_NAME)
    -lLoadBalancing-cpp_$(CONFIGURATION)_$(PLATFORM_NAME)
    


    If you want to use the objectiveC libraries, then (the relevant paths of) your project settings should look like the ones of our objectiveC demos:
    Library search paths:
    
    ../../../Common-objc/lib
    ../../../Photon-objc/lib
    ../../../LoadBalancing-objc/lib
    
    Header Search paths:
    
    ../../..
    
    Other Linker Flags:
    
    -lstdc++
    -force_load ../../../Common-objc/lib/libCommon-objc_$(CONFIGURATION)_$(PLATFORM_NAME).a
    -lCommon-objc_$(CONFIGURATION)_$(PLATFORM_NAME)
    -lPhoton-objc_$(CONFIGURATION)_$(PLATFORM_NAME)
    -lLoadBalancing-objc_$(CONFIGURATION)_$(PLATFORM_NAME)
    


    Of course the relative paths need to be adjusted to the relative location in which you place the Photon SDK in relation to your project file.
  • thanks it worked for me...
Sign In or Register to comment.