【发布时间】:2014-12-22 18:09:30
【问题描述】:
我正在编写一个具有多个子目录的应用程序。我创建了一个 Makefile 结构,以便子目录编译文件并执行“ar rvs”和“ranlib libxxx.a”以将档案创建到父目录中以进行链接。
但是“ld”命令遇到了以下问题。
ld: warning: ignoring file ./libxxx.a, file was built for archive which is not
the architecture being linked (x86_64):
./libxxx.a Undefined symbols for architecture x86_64:
我在 Mac OS X 10.10.1 上使用 gcc
我阅读了很多关于此的帖子。我尝试了“gcc -arch i386”,然后我遇到了同样的 i386 错误
Undefined symbols for architecture i386:
我安装了 gcc-4.9.2 并尝试使用它而不是默认的 gcc,但没有运气。我尝试使用 x86_64-apple-darwin14.0.0-g++-4.9.2 也没有帮助。
【问题讨论】: