Maya application code will not compile when MFnParticleSystem is added to code

StackOverflow https://stackoverflow.com/questions/6336998

  •  27-10-2019
  •  | 
  •  

سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top