无法使用OSX Lion编译C ++插件?

时间:2012-03-17 00:42:53

标签: c++ plugins maya

我一直在用C ++编写Maya的插件。我使用的Makefile在Snow Leopard上运行正常,但在Lion中没有。我在两种情况下都使用最新版本的Maya 2012。这是错误堆栈的顶部:

/Applications/Autodesk/maya2012/Maya.app/Contents/../../devkit/include/maya/OpenMayaMac.h:89:35: error: 
    AvailabilityMacros.h: No such file or directory
/Applications/Autodesk/maya2012/Maya.app/Contents/../../devkit/include/maya/OpenMayaMac.h:107:24: error: 
    sys/param.h: No such file or directory
/Applications/Autodesk/maya2012/Maya.app/Contents/../../devkit/include/maya/OpenMayaMac.h:114:40: error: 
    CoreServices/CoreServices.h: No such file or directory

这让我觉得这些文件位于Lion的不同位置,但我确实在/ usr / include /目录中看到它们,就像Snow Leopard一样。任何人都有类似的问题,想法和建议吗?

我使用的make文件如下:

# NOTE: MAYA_LOCATION on Mac OS X points to Maya.app/Contents
MAYA_LOCATION = /Applications/Autodesk/maya2012/Maya.app/Contents

# Change location if a non standard install.
DEVKIT_LOCATION = $(MAYA_LOCATION)/../../devkit

C++ =  g++

PREFERRED_ARCHITECTURE =

# Determine the architectures to build.
MAYABIN = ${MAYA_LOCATION}/bin/maya
MAYA_ARCHES = $(shell lipo -info $(MAYABIN) | sed 's/^.*://')

ifneq ($(PREFERRED_ARCHITECTURE),)
    MAYA_ARCHES = $(filter $(PREFERRED_ARCHITECTURE),$(MAYA_ARCHES))

    ifeq ($(MAYA_ARCHES),)
        $(error $(MAYABIN) does not support the '$(PREFERRED_ARCHITECTURE)' architecture.)
    endif
endif

ARCH_FLAGS =    $(patsubst %,-arch %,$(MAYA_ARCHES))

CFLAGS =    -DAW_NEW_IOSTREAMS -DCC_GNU_ -DOSMac_ -DOSMacOSX_ \
        -DOSMac_MachO_ -DREQUIRE_IOSTREAM -fno-gnu-keywords -fpascal-strings -O3 \
        $(ARCH_FLAGS) -D_LANGUAGE_C_PLUS_PLUS -isysroot /Developer/SDKs/MacOSX10.6.sdk \
        -include $(MAYA_LOCATION)/../../devkit/include/maya/OpenMayaMac.h \
        -shared

C++FLAGS =  $(CFLAGS)

INCLUDES =  -I. -I$(MAYA_LOCATION)/../../devkit/include

LDFLAGS =   -framework Carbon -framework OpenGL -framework GLUT -lOpenMayaUI

LD =        $(MAYA_LOCATION)/../../devkit/bin/mayald MAYA_ARCHES="$(MAYA_ARCHES)" MAYA_LOCATION="$(MAYA_LOCATION)"


all: VmExample.bundle


VmExampleNode.o: VmExampleNode.cpp 
    $(C++) -c VmExampleNode.cpp $(C++FLAGS) $(INCLUDES)

vmPluginMain.o: vmPluginMain.cpp
    $(C++) -c vmPluginMain.cpp $(C++FLAGS) $(INCLUDES)

VmExample.bundle: VmExampleNode.o vmPluginMain.o
$(LD) -dynamic -bundle -o VmExample.bundle VmExampleNode.o vmPluginMain.o ../core/libVexample.o $(LDFLAGS)

1 个答案:

答案 0 :(得分:0)

同样的问题;通过添加来管理它的工作 -mmacosx版本分钟= 10.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk

to C ++ Flags