ali-rantakari / trash

Small command-line program for OS X that moves files or folders to the trash.
574 stars 16 forks source link

0.9.2: `make` fails with `ld: symbol(s) not found for architecture i386` in XCode 10.2.1 #34

Open jjarava opened 5 years ago

jjarava commented 5 years ago

Hi!

When compiling 0.9.2 manually with XCode 10.2.1, make fails with the message: ld: symbol(s) not found for architecture i386

The message ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS) on the output gave me a hint, and changing the Makefile to remove -arch i386 from the invocation makes it compile successfully.

Below is the full output of make:

$ make

---- Compiling:
======================================
cc -O2 -Wall -Wextra -Wpartial-availability -Wno-unguarded-availability -force_cpusubtype_ALL -mmacosx-version-min=10.7 -arch i386 -arch x86_64 -framework AppKit -framework ScriptingBridge -o trash trash.m HGUtils.m HGCLIUtils.m fileSize.m
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks//ScriptingBridge.framework/ScriptingBridge.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks//ScriptingBridge.framework/ScriptingBridge.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks//AppKit.framework/AppKit.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks//AppKit.framework/AppKit.tbd
Undefined symbols for architecture i386:
  ".objc_class_name_NSAppleEventDescriptor", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSAutoreleasePool", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSByteCountFormatter", referenced from:
      pointer-to-literal-objc-class-name in HGUtils-5e7ca4.o
  ".objc_class_name_NSCharacterSet", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSFileManager", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSMutableArray", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSNumber", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSNumberFormatter", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSString", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
      pointer-to-literal-objc-class-name in HGUtils-5e7ca4.o
      pointer-to-literal-objc-class-name in HGCLIUtils-7c98a0.o
  ".objc_class_name_NSURL", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_NSUserDefaults", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
      pointer-to-literal-objc-class-name in HGCLIUtils-7c98a0.o
  ".objc_class_name_NSWorkspace", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  ".objc_class_name_SBApplication", referenced from:
      pointer-to-literal-objc-class-name in trash-8878c7.o
  "_AEGetParamDesc", referenced from:
      _main in trash-8878c7.o
  "_AESendMessage", referenced from:
      _main in trash-8878c7.o
  "_FSCloseIterator", referenced from:
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
  "_FSGetCatalogInfoBulk", referenced from:
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
  "_FSMoveObjectToTrashSync", referenced from:
      _main in trash-8878c7.o
  "_FSOpenIterator", referenced from:
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
  "_FSPathMakeRefWithOptions", referenced from:
      _main in trash-8878c7.o
      _sizeOfFolder in fileSize-f9f187.o
  "_GetMacOSStatusCommentString", referenced from:
      _main in trash-8878c7.o
  "_NSClassFromString", referenced from:
      _stringFromFileSize in HGUtils-5e7ca4.o
  "_NSCocoaErrorDomain", referenced from:
      _main in trash-8878c7.o
  "___CFConstantStringClassReference", referenced from:
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      CFString in trash-8878c7.o
      ...
  "___stack_chk_fail", referenced from:
      _main in trash-8878c7.o
      _listTrashContents in trash-8878c7.o
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
      _sizeOfFolder in fileSize-f9f187.o
  "___stack_chk_guard", referenced from:
      _main in trash-8878c7.o
      _listTrashContents in trash-8878c7.o
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
      _sizeOfFolder in fileSize-f9f187.o
      _main in trash-8878c7.o
      _listTrashContents in trash-8878c7.o
      _sizeOfDirectoryFSRef in fileSize-f9f187.o
      _sizeOfFolder in fileSize-f9f187.o
  "___stdinp", referenced from:
      _promptForChar in trash-8878c7.o
  "___tolower", referenced from:
      _promptForChar in trash-8878c7.o
  "_basename", referenced from:
      _main in trash-8878c7.o
  "_exit", referenced from:
      start in crt1.10.6.o
      _main in trash-8878c7.o
  "_free", referenced from:
      _promptForChar in trash-8878c7.o
  "_getcwd", referenced from:
      _main in trash-8878c7.o
  "_getline", referenced from:
      _promptForChar in trash-8878c7.o
  "_getopt$UNIX2003", referenced from:
      _main in trash-8878c7.o
  "_getuid", referenced from:
      _main in trash-8878c7.o
  "_objc_enumerationMutation", referenced from:
      _main in trash-8878c7.o
      _listTrashContents in trash-8878c7.o
  "_objc_msgSend", referenced from:
      _main in trash-8878c7.o
      _listTrashContents in trash-8878c7.o
      _VerbosePrintf in trash-8878c7.o
      _promptForChar in trash-8878c7.o
      _stringFromFileSize in HGUtils-5e7ca4.o
      _Print in HGCLIUtils-7c98a0.o
      _Printf in HGCLIUtils-7c98a0.o
      ...
  "_optind", referenced from:
      _main in trash-8878c7.o
  "_printf", referenced from:
      _promptForChar in trash-8878c7.o
  "_putchar", referenced from:
      _promptForChar in trash-8878c7.o
  "_strchr", referenced from:
      _promptForChar in trash-8878c7.o
  "_strlen", referenced from:
      _promptForChar in trash-8878c7.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [trash] Error 1
jjarava commented 5 years ago

Created Pull Request #35 with the change mentioned above