Apple Mach-O Linker errors and I don't know what to do

有些话、适合烂在心里 提交于 2019-11-30 05:56:50

For every one with an similar error. If that happens you normally can remove the "Path" under Point

target->Build Settings->Library Search Paths

Divine_Code

This error can occur when a framework is added to a project more than once.

  • You can fix this by removing the duplicate. To find it, select the framework in the Xcode project navigator and choose Show in Finder. Then clean and build your project.

This can also be caused if you're missing framework header files or a reference to them.

  • In that case, you should trying removing the SDK or framework and adding it again.

Good luck.

If you installed dependencies using CocoaPods, make sure you open your XCode project by clicking on your .xcworkspace file, and not the .xcodeproj file.

It seems like the project file may have been corrupted somehow.

The most sure way to fix this is to create a new project, and move your files and old info.plist over on top of it.

The next most likely way to fix this is to create a new target in your current project, and see if that will compile (if you have any special flags from the old target you'll want to copy them).

Also you could try compiling for Release vs. Build and if one of them works look at all of the compiler options and see what is different.

If you added a header search path for Sharekit, perhaps try clearing out the whole header search path and see if that fixes things. Also make sure your project is still including frameworks that a brand new project includes (UIKit and NSFoundation, possibly others).

Add the .m file to compile source page.

steps:-

  1. clicking on he project in the navigation menu
  2. select the target
  3. select build phases
  4. Select the + button and add the file in compile sources.

Hope that helps anyone with this problem

The problems are the spaces in your path:

xcode uses the following switch for the linker:

-F/Users/bbrandy95/Documents/Broken Brandsonic Web Projects/Brandsonic Web mobile/../../Downloads/0.2.1gm1/iphoneos4.0/System/Library/Frameworks

and since it is not quoted it won't work. ( It is looking for the folder "/Users/bbrandy95/Documents/Broken"

You should rename the directories, or look through the project settings and add quotes to the directories. (But this might be tricky to find)

I too had the same problem with 45 same kind errors, when I add the libxml2.dylib into my project the errors disappeared.

Gajendra K Chauhan

In some cases your library Search Path is empty.Because there are many Apple-mac-o linker errors.

See my answer also at.

Apple Mach-O Linker Error using Core Data classes in OCUnit

I had this issue, now for my circumstances selecting a more recent iOS version as the deployment target rectified this for me. My project was set to deploy to iOS 5 by default and changing this to 7 (the most recent) did the trick.

For anyone new to iOS development this can be done by clicking on your XCode project file in the navigator > deployment info > deployment target and selecting the appropriate version from the drop down menu.

I'm sceptical that this will solve some of the issues that others are having but there may be a few people out there in the same boat as me.

It's because the project inserted the core data's xcdatamodeld file in compile sources. Select your project -> Build Phases -> Compile Sources and delete projectName.xcdatamodeld file. And also check if you have imported .m file instead of .h file, it also gives the same linker error. Check all the #import codes. And check if you have added core data frame work in library and imported core data .h file. Check for creation of NSManagedObject and import it's file. Just try it and reply me if still any error.

I had the same problem,

I just simply set the Build Option -> Enable Bitcode to NO

I faced this problem with my self developed cocoapod.

Error was: Apple Mach-O Linker errror

It turned out, that I had defined a protocol and implemented a protocol extension. One method of the protocol extension was public, but the protocol itself was not. And this caused the Apple Mach-O Linker error.

Example:

protocol MyProtocol { var field: String { get} }

extension MyProtocol { public func giveMeSomething() -> String }

public class MyClass: MyProtocol {}

In the description the error mentioned MyClass referenced from MyProtocol -> MyProtocol referenced from giveMeSomething()...

So, the solution was to make Myprotocol also public

Hope that helps someone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!