首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法使用OSX Lion编译C++插件?

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

Stack Overflow用户
提问于 2012-03-17 08:42:53
回答 1查看 1.1K关注 0票数 0

我一直在用C++为Maya编写一个插件。我使用的Makefile在雪豹上工作得很好,但在狮子上就不行了。在这两种情况下,我都使用最新版本的Maya 2012。下面是错误堆栈的顶部:

代码语言:javascript
运行
复制
/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文件如下:

代码语言:javascript
运行
复制
# 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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-17 19:24:39

这里也有同样的问题;通过添加-mmacosx-version-min=10.6mmacosx- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -min=10.6mmacosx-version-min=10.6mmacosx-version-min=10.6 -isysroot -isysroot

至C++标志

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9746250

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档