Questions tagged [mach-o]

Executable file format utilized by Darwin.

Mach-O is the file format used for executables, shared libraries and object files on OS X and iOS. It supports both single-architecture and multiple-architecture ("fat") binaries.

371 questions
43
votes
3 answers

Determine minimum OSX version a binary was compiled for

When using Clang's or GCC's Darwin backends to create executables for OSX, the flag -mmacosx-version-min=version can be used to set the earliest version of OSX the executable will run on. Is there any way to trace back from a given executable which…
earl
  • 40,327
  • 6
  • 58
  • 59
40
votes
2 answers

Why is install_name_tool and otool necessary for Mach-O libraries in Mac Os X?

I am developing a Cocoa Application using the latest version of Xcode 4, I want to link dynamic libraries to my project (dylibs). I read somewhere that adding the libraries in my project was not enough as I have to run install_name_tool and otool to…
Alex
  • 2,247
  • 1
  • 27
  • 37
36
votes
2 answers

In Xcode project target build settings, What is Mach-O Type?

After getting tired of numerous Match-O linker error, I want to know that this thing means. Instead of trial and error solution, I would like to know the concept behind these things. Specifically I want to know the difference between…
Max
  • 3,371
  • 2
  • 29
  • 30
30
votes
4 answers

How do I create a dynamic library (dylib) with Xcode?

I'm building few command-line utilities in Xcode (plain C, no Cocoa). I want all of them to use my customized version of libpng, and I want to save space by sharing one copy of the library among all executables (I don't mind re-distributing .dylib…
Kornel
  • 97,764
  • 37
  • 219
  • 309
28
votes
10 answers

Found an unexpected Mach-O header code: 1918975009 in xCode 6

What causes the error Found an unexpected Mach-O header code: 1918975009 in xCode 6 I archived my project to send out as an ad hoc build and it builds/links/archives just fine but when I'm in the xCode organizer and select Export -> Ad Hoc, I get…
rtvanals
  • 341
  • 1
  • 3
  • 7
26
votes
12 answers

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

I cannot compile my project for the device or simulator anymore. I get 13 Apple Mach-O-Linker errors. It all started after I failed attempt to use sharekit. Here is the log from the error: ld: warning: directory not found for option…
Sega dude
  • 1,103
  • 3
  • 12
  • 29
26
votes
4 answers

Apple Mach-O linker (id) warning : building for MacOSX, but linking against dylib built for iOS

Starting from some point in the past xCode 4 in complaining about linker problems: ld: warning: building for MacOSX, but linking against dylib built for iOS: …
Igor
  • 261
  • 3
  • 4
25
votes
3 answers

Apple Mach-O linker warning won't go away

I have had this Apple Mach-O linker warning in my project for a few days now. It is more annoying than anything, but I fear that it may somehow be affecting my app's performance (I have had so many weird issues with Xcode, that I wouldn't doubt…
cory ginsberg
  • 2,907
  • 6
  • 25
  • 37
25
votes
11 answers

Linker command error: 'ld: symbol(s) not found for architecture i386'

I have an error at compile time. Seems to be weird. it worked as detail view application, but using single view doesn't seem to work. this is the error details: Undefined symbols for architecture i386: "_OBJC_CLASS_$_RssArticle", referenced…
Siddharthan Asokan
  • 4,321
  • 11
  • 44
  • 80
24
votes
2 answers

Swift: macro for __attribute__((section))

This is kind of a weird and un-Swift-thonic question, so bear with me. I want to do in Swift something like the same thing I'm currently doing in Objective-C/C++, so I'll start by describing that. I have some existing C++ code that defines a macro…
Quuxplusone
  • 23,928
  • 8
  • 94
  • 159
24
votes
4 answers

APPLE MACH-O LINKED ERROR After adding AFNetworking

Just adding AFNetworking into my project, and after B&R here i got this error like: Undefined symbols for architecture i386: "_SecCertificateCopyData", referenced from: -[AFURLConnectionOperation…
jokerdc
  • 261
  • 2
  • 6
23
votes
3 answers

Xcode gives Apple Mach-O linker error

I just compiled a project and Xcode returns these two errors which don't seem to be my code's fault. How do I fix them? Undefined symbols for architecture i386: "_vImageBoxConvolve_ARGB8888", referenced from: -[UIImage(Blur)…
kuranes
  • 546
  • 1
  • 6
  • 16
23
votes
4 answers

Go language on iPhone

Is it possible to write in Go for iPhone? I think following steps are required Compile Go as ARM Mach-O binary (I expect GCCGO be able to do that) Compile iPhone app as static library (I think it possible to rename main() -> main2(), etc) Compile…
Max
  • 6,286
  • 5
  • 44
  • 86
22
votes
2 answers

What path does @loader_path resolve to?

I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) …
ChrisB
  • 4,628
  • 7
  • 29
  • 41
19
votes
2 answers

mach-o file, but is an incompatible architecture have 'x86_64', need 'arm64e' M1 MAC

from PyQt6.QtWidgets import * from model.Department import Department from view.main_window import Ui_Form from model.Department import Department, Employee class Homewidget(QWidget,Ui_Form): def __init__(self): …
MrAhmed Alhamed
  • 223
  • 2
  • 3
  • 9
1
2 3
24 25