简体   繁体   English

在OS X的哪里可以找到符号_GetCurrentProcess?

[英]Where could I find symbol _GetCurrentProcess on OS X?

I'm linking nodejs as a static library to a simple c++ program on OS X 10.4 using Xcode, and I've been struggling with the following error: 我正在使用Xcode将nodejs作为静态库链接到OS X 10.4上的简单c ++程序,并且一直在尝试以下错误:

Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      node::Platform::SetProcessTitle(char*) in libnode.a(platform_darwin_5.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone have a guess in which framework I could locate this symbol? 有谁猜我可以在哪个框架中找到该符号? I read this post , and someone mentions this symbol is from libiodbc, but after I link with it, I still have the above error. 我读了这篇文章 ,有人提到这个符号来自libiodbc,但是在链接之后,仍然出现上述错误。 I already link my project with CoreServices, CoreFoudations, libz and a bunch of nodeJS related libs in Xcode. 我已经将我的项目与Xcode中的CoreServices,CoreFoudations,libz和一堆与nodeJS相关的库链接了。

I found it in the ApplicationServices framework. 我在ApplicationServices框架中找到了它。 Passing -framework ApplicationServices to clang worked for me. -framework ApplicationServices传递给clang对我-framework ApplicationServices

You can use the 'find' command on the command line to get a list of the library files. 您可以在命令行上使用“ find”命令来获取库文件列表。 Then run the 'nm' command with suitable arguments on each one until you find it. 然后在每个命令上运行带有适当参数的'nm'命令,直到找到它。 You can use the '-exec' switch on 'find' to make it easier by combining these two commands. 您可以通过结合使用这两个命令来在'find'上使用'-exec'开关,以使其变得更容易。

It looks to be a legacy function from the days of Carbon. 从Carbon时代起,它似乎已成为一项传统功能。 I don't understand any of it, but maybe if you link CarbonLib, it will fix the linker error. 我什么都不懂,但是也许如果您链接CarbonLib,它将解决链接器错误。

http://developer.apple.com/legacy/library/documentation/Carbon/Reference/Carbon_Spec_Porting/Process_Manager.html http://developer.apple.com/legacy/library/documentation/Carbon/Reference/Carbon_Spec_Porting/Process_Manager.html

Google search phrase: GetCurrentProcess site:developer.apple.com Google搜索短语:GetCurrentProcess网站:developer.apple.com

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

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