Mysql Objective-C Apple Mach-O连接器错误

Mysql Objective-C Apple Mach-O连接器错误,mysql,objective-c,xcode,Mysql,Objective C,Xcode,我试图在Objective-C中使用mySQL C连接器,但当我在xcode中运行应用程序时,出现以下错误: ld: warning: ignoring file /Users/NAME/Documents/GITHUB/lib/libmysqlclient.dylib, file was built for i386 which is not the architecture being linked (x86_64): /Users/NAME/Documents/GITHUB/lib/lib

我试图在Objective-C中使用mySQL C连接器,但当我在xcode中运行应用程序时,出现以下错误:

ld: warning: ignoring file /Users/NAME/Documents/GITHUB/lib/libmysqlclient.dylib, file was built for i386 which is not the architecture being linked (x86_64): /Users/NAME/Documents/GITHUB/lib/libmysqlclient.dylib
Undefined symbols for architecture x86_64:
  "_mysql_close", referenced from:
      -[APmySQLManager disconnectFromServer] in APmySQLManager.o
  "_mysql_error", referenced from:
      -[APmySQLManager handlemySQLError] in APmySQLManager.o
  "_mysql_fetch_field", referenced from:
      -[APmySQLQueryHelper getFieldsForResult:] in APmySQLQueryHelper.o
  "_mysql_fetch_row", referenced from:
      -[APmySQLQueryHelper queryWithRawQuery:] in APmySQLQueryHelper.o
  "_mysql_free_result", referenced from:
      -[APmySQLQueryHelper queryWithRawQuery:] in APmySQLQueryHelper.o
  "_mysql_init", referenced from:
      -[APmySQLManager connectWithServer:database:port:username:password:] in APmySQLManager.o
  "_mysql_num_fields", referenced from:
      -[APmySQLQueryHelper queryWithRawQuery:] in APmySQLQueryHelper.o
  "_mysql_query", referenced from:
      -[APmySQLQueryHelper queryWithRawQuery:] in APmySQLQueryHelper.o
  "_mysql_real_connect", referenced from:
      -[APmySQLManager connectWithServer:database:port:username:password:] in APmySQLManager.o
  "_mysql_server_init", referenced from:
      -[APmySQLManager init] in APmySQLManager.o
  "_mysql_stat", referenced from:
      -[APmySQLManager isConnectedToServer] in APmySQLManager.o
  "_mysql_use_result", referenced from:
      -[APmySQLQueryHelper queryWithRawQuery:] in APmySQLQueryHelper.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

MySQL库不支持x86_64体系结构。您需要获取基于此体系结构构建的库


您可以直接在设备上运行它将与设备一起工作。:)

您需要将适当的MySQL框架/库链接到您的项目。我该怎么做?它的库路径已经指向MySQL库那么我需要使用什么体系结构呢?你说的在设备上运行是什么意思?就像在实际的电话设备上运行,而不是在模拟器上运行一样?模拟器在不同的手机架构上运行,使用ARM架构。您的sql库不是针对模拟器体系结构进行切片的,但它适用于手机