NESAsm-3.1-Mac icon indicating copy to clipboard operation
NESAsm-3.1-Mac copied to clipboard

ld: library not found for -lgcc_s.10.5

Open ammianus opened this issue 6 years ago • 4 comments

Thanks for doing this project.

I tried make install from terminal and it had an error during linking

mkdir -p ./build/
clang -arch i386 -arch x86_64 -mmacosx-version-min=10.5 ./obj/assemble.o ./obj/code.o ./obj/command.o ./obj/crc.o ./obj/expr.o ./obj/func.o ./obj/input.o ./obj/macro.o ./obj/main.o ./obj/map.o ./obj/mml.o ./obj/nes.o ./obj/output.o ./obj/pce.o ./obj/pcx.o ./obj/proc.o ./obj/symbol.o -o ./build/nesasm
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [nesasm] Error 1

Any ideas? I have xcode and command-line tools

$ clang --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Mac OS version (Mojave)

ProductName:	Mac OS X
ProductVersion:	10.14.1
BuildVersion:	18B75

ammianus avatar Nov 17 '18 12:11 ammianus

Well, got past that error simply by changing the error by changing this line in the makefile LDFLAGS = -arch x86_64 -mmacosx-version-min=10.14

I also removed -arch i386 because of another error:

...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I guess I don't need i386 for my system so it's ok to just remove it?

ammianus avatar Nov 17 '18 13:11 ammianus

Hello!

I just tried on Mojave and get the same error. I know Apple has been announcing they're dropping support for 32-bit binaries soon, and it might be that some libraries required to build for 32-bit architectures (which i386 is) are absent from Mojave?

The flag is definitely not necessary if you are only building to run on a 64-bit machine no, you will be totally fine without. I will investigate further when I get the time!

amyinorbit avatar Nov 17 '18 20:11 amyinorbit

I was able to make it compile by removing the -arch i386 and updating the -mmacosx-version-min= to the version of my OS. Also updating gcc using homebrew might be useful

PaulienVa avatar Jun 14 '19 08:06 PaulienVa

I can confirm @PaulienVa advice. removing -arch i386 worked for me. I'm running macOS Catalina 10.15.3

jarrodparkes avatar Mar 17 '20 16:03 jarrodparkes