Maya Plug-in, Makefile and OSX

Hello, this is my first post here. I am a french student.

In my school I have no problems to compile with VC++ and load my plug-ins in Maya. But at home I am under OSX (Lion) and I can’t load my plug-ins, although they compile.

Yesterday I tried all day long to tune my Makefile but Maya tells me :
“InitializePlugin function could not be found in plug-in (myPlugin)”. The compiler doesn’t export initializePlugin and uninitializePlugin. I tried to add “extern” before these two functions, I added “-fPIC -shared” on the compiler flags, and so on. Now I’m stuck and I have no idea. If someone could help me, he would make my day, even my week!

Thanks a lot, AG.

(Do you think it’s the Lion’s fault?)

Here is my makefile :

PLUGIN_NAME = myPlugin
PLUGIN_EXT = bundle
SOURCES = additionNode.cpp
HEADERS = additionNode.h
LIBS = -lOpenMaya -lFoundation

MAYA_LOCATION = /Applications/Autodesk/maya2012
MAYA_INCLUDE_PATH = $(MAYA_LOCATION)/devkit/include
MAYA_LIB_PATH = $(MAYA_LOCATION)/Maya.app/Contents/MacOS
MAYA_PLUGIN_PATH = $(MAYA_LOCATION)/Maya.app/Contents/MacOS/plug-ins

CPP	 = g++

CPPFLAGS_32 = -DBits32_ -m32
CPPFLAGS_64 = -DBits64_ -m64

CPPFLAGS = -Wall -W -ansi \
		-DMAC_PLUGIN -DOSMac_MachO_  -DUNIX -D_BOOL -DOSMac_ -DFUNCPROTO -D_GNU_SOURCE  -fPIC \
		-fno-strict-aliasing -DREQUIRE_IOSTREAM -Wno-deprecated \
		-Wno-multichar -Wno-comment -Wno-sign-compare -funsigned-char \
		-Wno-reorder -fno-gnu-keywords -ftemplate-depth-25 -pthread \
		-Wno-deprecated -fno-gnu-keywords \
		-g -I$(MAYA_INCLUDE_PATH) \
  		$(CPPFLAGS_32)

#Yes I left CPPFLAGS_32 because it won't compile with CPPFLAGS_64. Do you think this is the reason?

LDFLAGS = -fPIC -shared -rdynamic -Wl,-executable_path,$(MAYA_LIB_PATH)
				

INCLUDE_FLAGS = -I. -I.. -I$(MAYA_INCLUDE_PATH) $(MAYA_INCLUDE_PATH)/maya/OpenMayaMac.h
LIB_FLAGS = -L$(MAYA_LIB_PATH) $(LIBS)

OBJECTS=$(SOURCES:.cpp=.o)


###################################################################


all: $(PLUGIN_NAME).$(PLUGIN_EXT)

$(PLUGIN_NAME).$(PLUGIN_EXT): $(OBJECTS)
	$(CPP) -o $@ $^ $(LDFLAGS)
	
%.o: %.cpp
	$(CPP) -o $@ -c $< $(CPPFLAGS)

$(OBJECTS): $(HEADERS)

install: $(PLUGIN_NAME).$(PLUGIN_EXT)
	cp -f $(PLUGIN_NAME).$(PLUGIN_EXT) $(MAYA_PLUGIN_PATH)

clean:
	rm *.o *.$(PLUGIN_EXT)