As is asked and answered in this post, I needed to give -arch i386 option for SWIG/C# integration.
Do I need to give the option for both compilation/link?
g++ -c -arch i386 example.cxx example_wrap.cxx
g++ -arch i386 -bundle -undefined suppress -flat_namespace example.o example_wrap.o -o libexample.dylib
Have you tried it? A simple test with a C program on OS X 10.6 with a 64-bit capable machine suggests that, in general, you do need to specify
-archfor both.Intuitively, the linker does need to know which set of architecture-specific libraries to link with.