[Chicken-users] swig and c++ and stuff

2007-02-26 Thread Tony Sidaway

I tried a big SWIG wrap on part of a C++ library.  This generated a
.cxx wrap file and a .scm file.

The build sequence I'm using is this:

  $(CHICKEN) tvision.scm -output-file otvision.c
   $(CXX) --shared otvision.c tvision_wrap.cxx -o tvision.so
`rhtv-config --include` `rhtv-config --cppflags` `rhtv-config
--dir-libs` `rhtv-config --dlibs` -lchicken

This seems to build to a tvision.so file, but when I install that and
(use tvision), I get this:


ersion 2.524 - linux-unix-gnu-x86 - [ libffi dload ptables applyhook cmake ]
(c)2000-2007 Felix L. Winkelmann
; loading /home/me/.csirc ...
; loading /usr/local/lib/chicken/1/readline.so ...
; loading library regex ...
#;1 (use tvision)
; loading /usr/local/lib/chicken/1/tvision.so ...
Error: (load) unable to load compiled module
/usr/local/lib/chicken/1/tvision.so
/usr/local/lib/chicken/1/tvision.so: undefined symbol:
_ZN6TGroup7matchesEP5TView

   Call history:

   syntax(use tvision)
   syntax(##core#require-extension (quote tvision))
   syntax(begin (begin (##sys#require (quote
tvision))) (##core#undefined))
   syntax(begin (##sys#require (quote tvision)))
   syntax(##sys#require (quote tvision))
   syntax(quote tvision)
   syntax(##core#undefined)
   eval  (##sys#require (quote tvision)) --

I'm a bit new to Swig wraps. Is this a common problem? If so, what
have I done wrong?


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] swig and c++ and stuff

2007-02-26 Thread Ivan Raikov

  What version of SWIG are you using? I've seen this problem with
versions prior to 1.3.29. 

   -Ivan


Tony Sidaway [EMAIL PROTECTED] writes:

 I tried a big SWIG wrap on part of a C++ library.  This generated a
 .cxx wrap file and a .scm file.

 The build sequence I'm using is this:

   $(CHICKEN) tvision.scm -output-file otvision.c
$(CXX) --shared otvision.c tvision_wrap.cxx -o tvision.so
 `rhtv-config --include` `rhtv-config --cppflags` `rhtv-config
 --dir-libs` `rhtv-config --dlibs` -lchicken

 This seems to build to a tvision.so file, but when I install that and
 (use tvision), I get this:


 ersion 2.524 - linux-unix-gnu-x86 - [ libffi dload ptables applyhook cmake ]
 (c)2000-2007 Felix L. Winkelmann
 ; loading /home/me/.csirc ...
 ; loading /usr/local/lib/chicken/1/readline.so ...
 ; loading library regex ...
 #;1 (use tvision)
 ; loading /usr/local/lib/chicken/1/tvision.so ...
 Error: (load) unable to load compiled module
 /usr/local/lib/chicken/1/tvision.so
 /usr/local/lib/chicken/1/tvision.so: undefined symbol:
 _ZN6TGroup7matchesEP5TView

Call history:

syntax(use tvision)
syntax(##core#require-extension (quote tvision))
syntax(begin (begin (##sys#require (quote
 tvision))) (##core#undefined))
syntax(begin (##sys#require (quote tvision)))
syntax(##sys#require (quote tvision))
syntax(quote tvision)
syntax(##core#undefined)
eval  (##sys#require (quote tvision)) --

 I'm a bit new to Swig wraps. Is this a common problem? If so, what
 have I done wrong?



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] swig and c++ and stuff

2007-02-26 Thread felix winkelmann

On 2/26/07, Tony Sidaway [EMAIL PROTECTED] wrote:

I tried a big SWIG wrap on part of a C++ library.  This generated a
.cxx wrap file and a .scm file.

The build sequence I'm using is this:

   $(CHICKEN) tvision.scm -output-file otvision.c
$(CXX) --shared otvision.c tvision_wrap.cxx -o tvision.so
`rhtv-config --include` `rhtv-config --cppflags` `rhtv-config
--dir-libs` `rhtv-config --dlibs` -lchicken

This seems to build to a tvision.so file, but when I install that and
(use tvision), I get this:



If you load the code with use, you *must* pass -shared to the Scheme
compiler. You also must pass `csc -shared -cflags -libs`. I recommend
to use csc instead of chicken + g++.

The missing symbol is strange, though. Check the _wrap.cxx file and
the binaries with nm (and c++filt


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] swig and c++ and stuff

2007-02-26 Thread Tony Sidaway

On 2/26/07, felix winkelmann [EMAIL PROTECTED] wrote:


The missing symbol is strange, though. Check the _wrap.cxx file and
the binaries with nm (and c++filt



genRefs() only appears as a friend function in the class prototypes;
it isn't implemented so it doesn't belong in the wrap.

I removed it and another class function that wasn't implemented, and
now it loads fine.  I can use the introspection procedures of tinyclos
to look at the slots and methods.  I suspect that any remaining
problems are due to my inexperience with tinyclos.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users