在 Xcode 中链接
如何正确制作 Xcode 链接目标文件?
包含“main”和所有依赖项的文件正确编译(我可以轻松地在命令行中链接它们以生成可执行文件)。然而,Xcode似乎拒绝这样做,导致ld错误“找不到符号”。
这就是我当前的设置。所有依赖项(计算器、输入等)都会被检测到并正确编译。 cpp文件包含main但无法链接到.o文件(由依赖项生成),导致出现多个ld“symbol not find”错误。
有什么想法吗?
How do I make Xcode link object files properly?
The file containing "main" and all the dependencies compile properly (and I can easily link them in the command line to generate the executable). However, Xcode seems to refuse to do it, resulting in ld errors of "symbol not found".
This is what my current setup looks like. All the dependencies (Calculator, input, etc) are detected and compile properly. The cpp file contains main but fails to be linked to the .o file (generated by the dependencies), resulting in several ld "symbol not found" errors.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由依赖项生成的 .o 不会链接到包含目标。在上面的示例中,“计算器”需要生成一些内容,通常是静态库 (.a),然后您可以将其添加到要链接到项目中的库列表中。
.o's generated by dependencies do not get linked into the including target. In the example above, "Calculator" needs to generate something, generally a static library (.a), that you would then add to the list of libraries to be linked into the project.