2012-03-17 77 views
0

我一直在用C++編寫Maya插件。 Makefile我在Snow Leopard上使用得很好,但不在Lion中。在這兩種情況下,我都使用最新版本的Maya 2012。下面是錯誤堆棧的頂部:無法用OSX Lion編譯C++插件?

/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 

這讓我覺得,這些文件是在獅子不同的位置,但我看到他們都在我的/ usr/include /下,就像雪豹。任何人都有類似的問題,想法和建議?

我使用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) 

回答

0

同樣在這裏的問題;設法使其通過添加 -mmacosx版本分鐘工作= 10.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk

到C++ Flags

+0

感謝您的回覆,幾乎與您的更改一起工作 - 我不記得當時還有什麼我必須做的,但它是非常小的。 – rykardo 2012-06-25 11:05:29