C++;包括问题 我用C++编写了Autodesk Maya的插件,并有链接错误。p>

C++;包括问题 我用C++编写了Autodesk Maya的插件,并有链接错误。p>,c++,include,maya,C++,Include,Maya,我的主要课程是Maya\u Search\u Plugin.cpp #include <Utilities.h> DeclareSimpleCommand( search_face, PLUGIN_COMPANY, "4.5"); //doIt method is entry point for plugin MStatus search_face::doIt( const MArgList& ) { //calls to Maya types/functions

我的主要课程是Maya\u Search\u Plugin.cpp

#include <Utilities.h>

DeclareSimpleCommand( search_face, PLUGIN_COMPANY, "4.5");

//doIt method is entry point for plugin
MStatus search_face::doIt( const MArgList& )
{
    //calls to Maya types/functions and Utilities functions
}
我认为这是一个链接错误,在某个地方有一些循环引用,但我不能确定它在哪里

谢谢你的帮助


谢谢。

我知道这已经一岁了。但几分钟前我又无意中发现了


在包含任何内容之前。例如。

如果您有多个包含MFnPlugin.h的文件,则可能会发生此问题。

Maya版本?XCode版本?Maya 2014,XCode 4.6.3是的,我在主类中使用宏,如devkit中的演示材料所示。您是否能够从SDK重建和使用插件示例?DeclareSimpleCommand(search_face,PLUGIN_COMPANY,“4.5”);
#ifndef __Maya_CPP_Plugin__Utilities__
#define __Maya_CPP_Plugin__Utilities__
//#pragma once

//standard libs
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <iostream>
#include <math.h>

//maya libs
#include <maya/MDagPath.h>
#include <maya/MFn.h>
#include <maya/MFileIO.h>
#include <maya/MIOStream.h>
#include <maya/MFnMesh.h>
#include <maya/MFnTransform.h>
#include <maya/MGlobal.h>
#include <maya/MSelectionList.h>
#include <maya/MSimple.h>
#include <maya/MTypes.h>
#include <maya/MPointArray.h>
#include <maya/MObjectArray.h>


class Utilities{
    public: static const int max_mov = 50;
public:
    static double get_mesh_error(MPointArray, MPointArray, int);
    static MStatus translateManipulator(double amount, MObject *path);
    static void GetSelected(MObjectArray* objects, MFn::Type type);
};

#endif /* defined(__Maya_CPP_Plugin__Utilities__) */
#include <Utilities.h>

double Utilities::get_mesh_error(MPointArray a, MPointArray b, int vertexCount){
   ...
}


MStatus Utilities::translateManipulator(double amount, MObject *path){
   ...
}


void Utilities::GetSelected(MObjectArray* objects, MFn::Type type) {
   ...
}
duplicate symbol _MApiVersion in:
    /Users/tmg06qyu/Library/Developer/Xcode/DerivedData/Maya_CPP_Plugin-hjrwvybwlvqyyscbmixdkcpdzjqr/Build/Intermediates/Maya_CPP_Plugin.build/Debug/Maya_CPP_Plugin.build/Objects-normal/x86_64/Maya_Search_Plugin.o
    /Users/tmg06qyu/Library/Developer/Xcode/DerivedData/Maya_CPP_Plugin-hjrwvybwlvqyyscbmixdkcpdzjqr/Build/Intermediates/Maya_CPP_Plugin.build/Debug/Maya_CPP_Plugin.build/Objects-normal/x86_64/Utilities.o
ld: 1 duplicate symbol for architecture x86_64
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld failed with exit code 1
#define MNoVersionString
#define MNoPluginEntry
#include <maya/MFnPlugin.h>
#include <maya/MFnPlugin.h>
// This is added to prevent multiple definitions of the MApiVersion string.
#define _MApiVersion