Re: Need help with loading .SO file



ShurikAg@xxxxxxxxx wrote:
ShurikAg@xxxxxxxxx wrote:
Shuri...@xxxxxxxxx wrote:
Michael Schlenker wrote:
ShurikAg@xxxxxxxxx schrieb:
Tobias Hippler wrote:
ShurikAg@xxxxxxxxx wrote:
There is Proc.cpp:
How do I suppose to do it?
I think it somthing like: gcc -fPIC -l libtk8.3.a -c Proc.cpp
But it doesn't work...
Its the wrong lib. You initialize STUBS in your code, so link with the
stubs lib and define -DUSE_TCL_STUBS during compile. libtclstub8.3.a is
the lib in your case.

Is it durin the compiling or during linking?

this is what I'm doing:
ismc01 [164] gcc -fPIC -c Proc.cpp

ismc01 [165] gcc -shared -L
/nfs/iil/itools/sun4m_solaris_2.6/pkgs/tcl-tk/8.3.2/lib/ -ltclstub8.3
-o Proc.so Proc.o

every thing compiles without problems.
Then, in "wish8.3":
% load /nfs/iil/disks/home05/aagulya/TCL/Proc.so
couldn't load file "/nfs/iil/disks/home05/aagulya/TCL/Proc.so":
ld.so.1: wish8.3: fatal: relocation error: file
/nfs/iil/disks/home05/aagulya/TCL/Proc.so: symbol __gxx_personality_v0:
referenced symbol not found

No idea where this symbol comes from, sounds like gcc...

Try:
gcc -fPIC -DUSE_TCL_STUBS=1 -c Proc.cpp
gcc -shared -L /nfs/iil/itools/sun4m_solaris_2.6/pkgs/tcl-tk/8.3.2/lib/
-ltclstub8.3 -o Proc.so Proc.o

another thing:
the command: gcc -shared -L
/nfs/iil/itools/sun4m_solaris_2.6/pkgs/tcl-tk/8.3.2/lib/ -ltclstub8.3
-o Proc.so Proc.o
taking into acount only the dynamic library (libtclstub8.3.so), isn't
it?
There is no dynamic lib libtclstub8.3.so, only a static libtclstub8.3.a,
STUBS allows you to load your extension into Tcl 8.5/Tcl 8.4 without a
recompile, which would otherwise be needed. Additionally it allows you
to use your extension in wrapped form (for example in starkits).

what I need is static...
What do you need static (and why?) If you need a fully static tclsh with
some extra functionalities you are on the wrong track. Static packages
work differently, see the tclkit or dqkit builds for some nice single
file shells with extra static packages included.

And to repeat myself: Tcl 8.3.2 is ancient, get something more recent.

Michael




.



Relevant Pages

  • Re: Getting started on the HP49g+
    ... either the original HP extable lib ... extable2 lib from http://www.hpcalc.org/details.php?id=3940. ... ask again if you have any problem installing libraries. ... compile the string with ASM (listed in the development lib menu, ...
    (comp.sys.hp48)
  • Re: Help on coredll.dll
    ... I have compiled the code using eVC 3.0 and have no problem, ... So I guess I need an extra lib for SIP support in cVC 4.0. ... I use standard SDK and try to compile for ARM device. ...
    (microsoft.public.windowsce.app.development)
  • Compiling test classes that use mock objects from other Netbeans project
    ... Netbeans project. ... main and lib. ... project) so in the main project I had to add a reference to the lib ... fine and allows B.java to compile perfectly. ...
    (comp.lang.java.help)
  • Re: Compiling from native to managed VC++ /clr option dramatically enlarge static lib size.
    ... I guess that you compile all your souce files with /clr. ... need to compile to managed code. ... in addition to that there is a P/Invoke function ... If the lib contains many functions that wrap another functions 1:1, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Where can I find a C complier
    ... > usually contain information that is usefull to compile the program. ... If a important lib wasnt found, ... Download the httpd package from apache.org ... Install the kernel-source package for the kernel you are running. ...
    (Fedora)