From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5461 invoked by alias); 4 Apr 2002 13:56:32 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5450 invoked from network); 4 Apr 2002 13:56:29 -0000 Received: from unknown (HELO lehi.webleicester.co.uk) (195.146.160.4) by sources.redhat.com with SMTP; 4 Apr 2002 13:56:29 -0000 Received: from there (host213-120-4-98.webport.bt.net [213.120.4.98]) by lehi.webleicester.co.uk (Postfix) with SMTP id DD5461BE67 for ; Thu, 4 Apr 2002 14:16:39 +0100 (BST) Content-Type: text/plain; charset="iso-8859-15" From: Graeme Phillipson To: Subject: Inheriting from a class inside a shared object? Date: Thu, 04 Apr 2002 06:52:00 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020404131639.DD5461BE67@lehi.webleicester.co.uk> X-SW-Source: 2002-04/txt/msg00040.txt.bz2 Hello, I'm trying to use swig so that I can extend a project I've already created to have Python scripting. However I've run into some problems (I've never used swig before BTW). I can't use the template makefiles provided, because I already have a makefile, so I've edited Makefile.am to include:- arguspythoninterface_wrap.o: arguspythoninterface_wrap.c $(CC) -c -I/usr/include/python2.1/ -I/usr/lib/python2.1/config/ $< arguspythoninterface_wrap.c: arguspythoninterface.i swig -v -c++ -python arguspythoninterface.i and arguspythoninterface_wrap.o is linked against when building the end result executeable. I also added:- Py_Initialize(); swig_add_builtin(); PyImport_Inittab = _SwigImport_Inittab; To my python startup code, and made a copy of embed.i and removed its main function. However when I try this, linker errors spew forth from every corner of my project. The other way I thought of doing this was to start again with the interface and make a sharded modelu my main program can link against. To test this I tried moving examplemodule.so (which I had made from the tutorial) to my program directory and seeing if I could load module example. When I try it from the command line it works, but if I try it from my program it can't find the module. If anyone could provide me with any help in using either of those two methods it would be greatly apprecideted. Thanks, Graeme Phillipson.