简体   繁体   English

如何在新程序中包含来自其他C ++文件的功能(对于Mac OSX应用程序)

[英]How to include functions from other C++ files in a new program (for Mac OSX applications)

How can I import functions from one Mac program I already have into a new program. 如何从已经拥有的Mac程序中导入功能到新程序中。 Both are in the same workspace, but I want too access functions from the older one in the new one. 两者都在同一个工作空间中,但是我也想从新的旧功能中访问旧的功能。 I tried just copying and pasting the functions over (I know, not the greatest way to do it), but got mach-o linker errors that I couldn't fix. 我尝试过仅复制和粘贴函数(我知道,这不是最好的方法),但是遇到了无法修复的mach-o链接器错误。

Here is permanent solution.Generally overwriting project may cause this prolems.Try this method. 这是永久的解决方案。通常,覆盖项目可能会导致此问题。请尝试此方法。

-UPDATE - Clang error - Mach-O Linker error -UPDATE-lang声错误-Mach-O链接器错误

In some case error log window displaying .xctest error, to fix it 在某些情况下,错误日志窗口会显示.xctest错误,以进行修复

-> Select your project ->选择您的项目

-> Beside this(just before General tab) select your projectTest file from dropdown ->在此旁边(在“常规”选项卡之前)从下拉列表中选择您的projectTest文件

-> There is one option (like ProjNameTests) ->有一个选项(例如ProjNameTests)

-> In Host Application, select your project from dropdown only if it show custom ->在“主机应用程序”中,仅当项目显示自定义时,才从下拉列表中选择项目

DONE! 完成!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM