chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: SWIG stuff again


From: John Lenz
Subject: [Chicken-users] Re: SWIG stuff again
Date: Tue, 19 Oct 2004 05:57:41 +0000

On 10/19/04 00:50:59, felix winkelmann wrote:
On Tue, 19 Oct 2004 04:55:39 +0000, John Lenz <address@hidden> wrote:
> On 10/18/04 01:09:48, felix winkelmann wrote:
> > > - This is causing a problem, because the linkage doesn't work for some
> > > reason.  The generated chicken code uses C_retrieve2 to get the
> > primitive:
> > > symbol, but it can't be found....
> >
> > How do you link? If you link statically, you will have to pass
> > libchicken last. Are you using csc?
> > Well actually I tried both ways. The SWIG file Examples/Makefile.in has
> the ability to compile either using csc or also invoking chicken and then
> the compiler.  Basicly, I link together the c file resulting from compiling
> example.scm with the example_wrap.cxx file which contains the SWIG
> functions into one dynamic library libexample.so.  This one library then
> contains all the code related to the example unit, and is then loaded by
> (load-library) to actually get used.

Do you link in libchicken(.so)?

chicken `echo newobject2.scm | sed 's/_/-/g'` -quiet \
       -dynamic -feature chicken-compile-shared \
       -output-file newobject2_chicken.c
g++ -c -fpic  -O2 -DC_STACK_GROWS_DOWNWARD=1 
-DC_INSTALL_LIB_HOME=/usr/lib/chicken -DC_USE_C_DEFAULTS \
       -I../../../Examples/test-suite/chicken -I../../../Examples/test-suite  
newobject2_wrap.cxx   newobject2_chicken.c
g++ -shared  newobject2_chicken.o   newobject2_wrap.o \
         -lchicken -lstuffed-chicken -lsrfi-chicken -ldl -lm -ldl  -lieee -lm  
-lcrypt -o newobject2.so

or if VARIENT=_csc is used to build, the following

csc -sv `echo newobject2.scm | sed 's/_/-/g'`  newobject2_wrap.cxx  -o 
newobject2.so
/usr/bin/chicken newobject2.scm -output-file newobject2.cpp -dynamic -feature 
chicken-compile-shared -quiet
g++ newobject2_wrap.cxx -o newobject2_wrap.o -g -fPIC -DPIC -DC_SHARED -c 
-DC_NO_PIC_NO_DLL
g++ newobject2.cpp -o newobject2.o -g -fPIC -DPIC -DC_SHARED -c 
-DC_NO_PIC_NO_DLL
rm newobject2.cpp
g++ -o newobject2.so newobject2_wrap.o newobject2.o -lchicken -lsrfi-chicken 
-lstuffed-chicken -fPIC -shared -L/usr/lib -Wl,-R/usr/lib -ldl -lpcre -lm  -ldl 
-lpcre
rm newobject2.o
rm newobject2_wrap.o


both fail with
Error: unbound variable: "primitive:Foo-dummy-set"

newobject2.scm: 10   swig-init
newobject2.scm: 26   list
newobject2.scm: 26   list
newobject2.scm: 26   make
newobject2.scm: 28   list
newobject2.scm: 28   ##tinyclos#add-global-method
newobject2.scm: 50   list
newobject2.scm: 52   list
make: *** [newobject2.cpptest] Error 70






reply via email to

[Prev in Thread] Current Thread [Next in Thread]