1

I'm facing this problem when I upgrade my facebook sdk from 4.5.1 to 4.13.1 in my xcode project.

I have replaced those Facebook SDK files: Bolts, FBAudienceNetwork, FBSDKCoreKit, FBSDKLoginKit, FBSDKMessengerShareKit, FBSDKShareKit then I get Undefined symbols for architecture x86_64 from FBAudienceNetwork on the methods below:

"_xmlFreeDoc", referenced from:

"_xmlLastError", referenced from:

"_xmlReadMemory", referenced from:

"_xmlXPathCastToBoolean", referenced from:

"_xmlXPathCastToNumber", referenced from:

"_xmlXPathCastToString", referenced from:

"_xmlXPathCompile", referenced from:

"_xmlXPathCompiledEval", referenced from:

"_xmlXPathFreeCompExpr", referenced from:

"_xmlXPathFreeContext", referenced from:

"_xmlXPathFreeObject", referenced from:

"_xmlXPathNewContext", referenced from:

"_xmlXPathRegisterNs", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Cœur
  • 37,241
  • 25
  • 195
  • 267
Harvey
  • 1,353
  • 1
  • 14
  • 27
  • Could this help you? http://stackoverflow.com/questions/8033179/iphone-libxml2-undefined-symbols-with-gdata-kissxml-touchxml-etc.. Try adding the .dylib file mentioned in the answer. See if that helps. – GenieWanted Jul 04 '16 at 05:00
  • Thanks GenieWanted, i did that before and the problem stayed still. ^^ – Harvey Jul 04 '16 at 07:44
  • Running into this now. ^^" Did you ever find the solution? – atkayla Feb 27 '17 at 09:21
  • did you ever figure this out? @roachman – maiko Apr 30 '17 at 20:24
  • 1
    @maiko Hmm yes I did, as I have Facebook SDK/Audience Network working in my app now... haha, but I'm not sure what the particular solution to this was. I believe I just linked the framework incorrectly in xcode. Had to select "Copy items if needed" or something and make sure it was in ~/Documents/FacebookSDK. – atkayla Apr 30 '17 at 20:28

3 Answers3

6

I fixed this by including the libxml2.dylib in my project manually.

I'll include steps for anyone that stumbles up on this.

  1. Click the folder at the top of Xcode's project pane, and select the first item in your project (it usually has the xcode icon).

enter image description here

  1. Click the General tab and find "Linked Frameworks and Libraries"

enter image description here

  1. Scroll all the way to the Bottom of Linked Frameworks and Libraries and click the plus sign at the bottom to add a new Framework

enter image description here

  1. Click Add Other on the framework selection window

enter image description here

  1. A basic browse/choose file window will open, click Macintosh HD on the left (optional, but it will make sure you're in the correct place)

enter image description here

  1. Press CMD+SHIFT+G to bring up the Go to Folder window.

enter image description here

  1. From this folder, find the file libxml2.dylib and double click it.

enter image description here

  1. Save, Clean and Rebuild just to be safe, and you should be good to go.
maiko
  • 405
  • 1
  • 4
  • 15
3

You can also add "-lxml2" to your "Other Linker Flags" Xcode Project Settings

0

"You can also add "-lxml2" to your "Other Linker Flags" Xcode Project Settings"

This Work for me like a charm