将 MFnParticleSystem 添加到代码时,Maya 应用程序代码将无法编译
我是创建 Maya 应用程序的新手,并且尝试使用粒子系统,但每当我尝试在 Mac 上编译代码时,都会收到以下错误。
/Applications/Autodesk/maya2011/Maya.app/Contents/../../devkit/bin/mayald MAYA_ARCHES=" i386 x86_64 " MAYA_LOCATION="/Applications/Autodesk/maya2011/Maya.app/Contents" -o test test.o
Undefined symbols for architecture x86_64:
"MFnParticleSystem::~MFnParticleSystem()", referenced from:
_main in test.o
"MFnParticleSystem::MFnParticleSystem()", referenced from:
_main in test.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Undefined symbols for architecture i386:
"MFnParticleSystem::~MFnParticleSystem()", referenced from:
_main in test.o
"MFnParticleSystem::MFnParticleSystem()", referenced from:
_main in test.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zzzivhrRnAmviuee+++G0k++2Ug/-Tmp-//cc9f4J54.out (No such file or directory)
make: *** [test] Error 1
文件中的代码
#include <MFnParticleSystem.h>
int main(int, char**)
{
MFnParticleSystem fn;
}
这是我在 SnowLeopard 上的 Maya2011 上运行的
。我完全不明白为什么这不能编译。
I am new with creating Maya applications and I am trying to use a particle system, but whenever I try to compile the code on my Mac I get the following error.
/Applications/Autodesk/maya2011/Maya.app/Contents/../../devkit/bin/mayald MAYA_ARCHES=" i386 x86_64 " MAYA_LOCATION="/Applications/Autodesk/maya2011/Maya.app/Contents" -o test test.o
Undefined symbols for architecture x86_64:
"MFnParticleSystem::~MFnParticleSystem()", referenced from:
_main in test.o
"MFnParticleSystem::MFnParticleSystem()", referenced from:
_main in test.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Undefined symbols for architecture i386:
"MFnParticleSystem::~MFnParticleSystem()", referenced from:
_main in test.o
"MFnParticleSystem::MFnParticleSystem()", referenced from:
_main in test.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zzzivhrRnAmviuee+++G0k++2Ug/-Tmp-//cc9f4J54.out (No such file or directory)
make: *** [test] Error 1
This is the code in the file
#include <MFnParticleSystem.h>
int main(int, char**)
{
MFnParticleSystem fn;
}
I am running on Maya2011 on SnowLeopard.
I'm completely stuck on why this will not compile.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能不会在项目中包含 Maya 框架,以便它与可执行文件链接。您可以通过将 OpenMaya 库添加到项目来解决此问题。 (我不确定您是否也不需要其他库)。无论如何,请查看您有权访问的 Maya API 文档。
You are likely not including the Maya framework in your project so that it is linked with your executable. You can fix this by adding the OpenMaya library to the project. (I am not sure that you don't need other libraries as well). In any case, look at the Maya API documentation that you have access to.
您是否按照 autodesk 在线帮助?
尝试查看提供的独立应用程序的 Makefile,看看它们是否链接到粒子库/框架,然后从那里将适当的选项复制到
mayald
。Have you followed the instructions from the autodesk online help?
Try looking at the Makefiles for the supplied stand-alone applications to see if any of them link to the particle library/framework and then copy the appropriate option to
mayald
from there.