我正在编写一个具有多个子目录的应用程序.我创建了一个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:
Run Code Online (Sandbox Code Playgroud)
我在Mac OS X 10.10.1上使用gcc
我读了很多帖子.我试过"gcc -arch i386",然后我遇到了i386的同样错误
Undefined symbols for architecture i386:
Run Code Online (Sandbox Code Playgroud)
我安装了gcc-4.9.2并尝试使用它而不是默认的gcc,没有运气.我尝试使用x86_64-apple-darwin14.0.0-g ++ - 4.9.2,这也没有帮助.