What am I doing wrong with SWIG in OS X Snow Leopard?

Z

Zectbumo

Here are the steps I am doing that cause me to get the error
ImportError: No module named _hi.
I'm running OS X 10.6.1 What am I doing wrong?

mkdir -p /tmp/my_swig_test
cd /tmp/my_swig_test
cat >hi.c<<.
#include <stdio.h>
void hello(void) {printf("Hello World\n");}
..
gcc -shared -o libhi.dylib hi.c
cat >hi.i<<.
%module hi
%include "hi.c"
..
swig -python hi.i
gcc -shared -I/System/Library/Frameworks/Python.framework/Headers -
framework Python -L. -lhi -o _hi.dylib hi_wrap.c
DYLD_LIBRARY_PATH=. python -c 'import hi; hi.hello()'
 
A

Aahz

Here are the steps I am doing that cause me to get the error
ImportError: No module named _hi.
I'm running OS X 10.6.1 What am I doing wrong?

You probably want to ask on pythonmac-sig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top