samcarter
I'm trying to build the https://github.com/macports/macports-legacy-support library outside MacPorts on OSX 10.9. I tried with
```
export FORCE_ARCH=x86_64
make
```
but this gives me the error
```
install -d -m 755 lib
cc -dynamiclib -headerpad_max_install_names -install_name @executable_path/../lib/libMacportsLegacySupport.dylib -current_version 1.0 -compatibility_version 1.0 src/arc4random.dl.o src/atcalls.dl.o src/best_fchdir.dl.o src/fsgetpath.dl.o src/getdelim.dl.o src/getline.dl.o src/lchmod.dl.o src/macports_legacy_realpath.dl.o src/macports_legacy_sysconf.dl.o src/memmem.dl.o src/posix_memalign_emulation.dl.o src/sincos.dl.o src/strings.dl.o src/strndup.dl.o src/strnlen.dl.o src/time.dl.o src/wcpcpy_family.dl.o src/wcscasecmp_family.dl.o src/wcsdup.dl.o src/wcsnlen.dl.o src/fdopendir.dl.o -o lib/libMacportsLegacySupport.dylib
Undefined symbols for architecture x86_64:
"_close$UNIX2003", referenced from:
_fdopendir$UNIX2003 in fdopendir.dl.o
_fdopendir$INODE64$UNIX2003 in fdopendir.dl.o
"_open$UNIX2003", referenced from:
_fdopendir$UNIX2003 in fdopendir.dl.o
_fdopendir$INODE64$UNIX2003 in fdopendir.dl.o
"_opendir$INODE64$UNIX2003", referenced from:
_fdopendir$INODE64$UNIX2003 in fdopendir.dl.o
"_opendir$UNIX2003", referenced from:
_fdopendir$UNIX2003 in fdopendir.dl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libMacportsLegacySupport.dylib] Error 1
```
Any ideas?
Top Answer
Jack Douglas
It looks like you need `FORCE_ARCH="-arch x86_64"`.
This is based on a bit of guesswork from looking at the macports source code [here](https://github.com/macports/macports-legacy-support/blob/f0fc982fe3b8addc5eec77a1479d88500af48988/Makefile#L170) and [this commit](https://github.com/rtv/Stage/commit/a1110d12691ab2d3679c7a028f97848a465c0dbe.patch) from a different project:
> …
> -# uncomment this to force 32bit on OS X, for example if you can't build FLTK 64bit
> -# e.g. using MacPorts on 10.6 Snow Leopard
> -#if( PROJECT_OS_OSX )
> -# SET( FORCE_ARCH "-arch i386" )
> …