[英]C Program (in OS X) - file was built for archive which is not the architecture being linked (x86_64)
I have an assignment in which I have to use a given source code with an included library, namely, libdb_factory.a and libdb_factory32.a (they gave us both x86_64 and ie386 versions). 我有一个任务,我必须使用包含库的给定源代码,即libdb_factory.a和libdb_factory32.a(他们给了我们x86_64和ie386版本)。
The first hint of something going wrong is that, when executing lipo -info on any of them , I get this: 出现问题的第一个暗示是,当在任何一个上执行lipo -info时,我得到了这个:
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: archive
with no architecture specification: libdb_factory32.a
(can't determine architecture for it)
Whenever I try to compile the code with make, I get the following: 每当我尝试使用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
The referenced functions are part of the library which is ignored. 引用的函数是库的一部分,被忽略。 I don't have access to a linux machine (unless I use a virtual machine) but I know it works alright on ubuntu 14.04.
我无法访问Linux机器(除非我使用虚拟机),但我知道它在ubuntu 14.04上运行正常。
Does anyone know what can I do? 有谁知道我能做什么? Any help would be kind appreciated.
任何帮助都会很感激。
Static libraries (ie the object files within them) compiled for Linux cannot be used on OSX. 为Linux编译的静态库(即其中的目标文件)不能在OSX上使用。
The only thing you can do is: 你唯一能做的就是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.