Assembly executable on osx - macos

I got nasm and I want to compile assembly into an executable. I keep getting the error:
ld: warning: ignoring file firststart.asm, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
when I try to compile with gcc. I am using gcc that comes with xcode. What am I doing wrong?

Related

Cuba library: Undefined symbols for architecture x86_64

I'm working on a M1 and trying to compile a cpp code with libquadmath and the Cuba library.
On the site (http://www.feynarts.de/cuba/) is said that
I can easily make use of GNU C compiler, problem is (and here I'm guessing) I get the following error I'm not sure why.
ignoring file ./lib/libcuba.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"_llVegas", referenced from:
_main in ccucELGn.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
Any guesses?
Thanks everyone

multiple errors with my audio toolbox

i have 3 errors and one warning when trying to play sound on my app. i am fairly new to xcode.
ld: warning: ignoring file /Users/harrisschrick/Documents/Test app/AudioToolbox.framework/AudioToolbox, missing required architecture x86_64 in file /Users/harrisschrick/Documents/Test app/AudioToolbox.framework/AudioToolbox (3 slices)
Undefined symbols for architecture x86_64:
"_AudioServicesCreateSystemSoundID", referenced from:
-[humordepotViewController viewDidLoad] in humordepotViewController.o
"_AudioServicesPlaySystemSound", referenced from:
-[humordepotViewController PlayAudioButton:] in humordepotViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any help at all would be amazing!

Xcode error - Undefined symbols for architecture x86_64:

I have this error in XCode:
Undefined symbols for architecture x86_64:
"Parser::Parser(char const*)", referenced from:
___cxx_global_var_init in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Very common reason is using a static library that is compiled for 32 bit only.

Xcode 5 error Undefined Symbols for Architecture i386

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_TraktAPIClient", referenced from:
objc-class-ref in ViewController.o
"_kTraktAPIKey", referenced from:
-[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the error I get when I try to compile my xcode program
You are trying to use a library "TraktAPIClient" for i386. This library does not seems to contain any compiled code for this architecture. If you are building for iOS, you should target armv7 and armv7s.

Linker error when compiling in Xcode

I am getting this error when I am compiling a program in Xcode.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyDatabase", referenced from:
objc-class-ref in Gallery_CollectionViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You have forgotten to add the source file that implements the class MyDatabase to the Xcode target and consequently it hasn't been compiled and linked with the binary.

Resources