我有一个任务,在这个任务中,我必须使用包含库的给定源代码,即libdb_factory.a和libdb_factory32.a(它们提供了x86_64和ie386版本)。
出现问题的第一个提示是,当对其中任何一个执行lipo-info时,我得到:

fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: archive
with no architecture specification: libdb_factory32.a
(can't determine architecture for it)

每当我试图用make编译代码时,我会得到以下结果:
Compiling
-n
-n Concurent example [..
ld: warning: ignoring file ./lib//libdb_factory.a, file was built for
 archive which is not the architecture being linked (x86_64): ./lib//libdb_factory.a
Undefined symbols for architecture x86_64:
  "_db_factory_create_element", referenced from:
  _insert_create in factory-0aefa1.o
  "_db_factory_get_element_name", referenced from:
      _transporter in factory-0aefa1.o
  "_db_factory_get_ready_state", referenced from:
      _transporter in factory-0aefa1.o
  "_db_factory_get_stock", referenced from:
      _transporter in factory-0aefa1.o
      _receiver in factory-0aefa1.o
      _insert_update in factory-0aefa1.o
  "_db_factory_init", referenced from:
      _init_factory in factory-0aefa1.o
  "_db_factory_update_stock", referenced from:
      _transporter in factory-0aefa1.o
      _insert_update in factory-0aefa1.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: *** [all] Error 1

引用的函数是被忽略的库的一部分。
我没有权限访问linux机器(除非我使用虚拟机),但我知道它在Ubuntu14.04上可以正常工作。
有人知道我能做什么吗?任何帮助都将不胜感激。

最佳答案

为Linux编译的静态库(即其中的对象文件)不能在OSX上使用。
你唯一能做的就是:
访问源代码并创建库的OSX版本。
使用虚拟机生成代码。

10-02 02:05