text: Board index » perl modules
  All times are UTC
  I am having trouble loading a shared lib.
  the code for LOAD.xs is as below:
  ********************************************
  #ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifdef __cplusplus
  MODULE = LOAD PACKAGE = LOAD
  shl_t shl_load(path) char* path CODE: shl_t addr= shl_load(path,BIND_DEFERRED, (long)0); printf("shl_load(): return value = %d\n", (int)addr); if (addr ==NULL) { printf("errno = %d\n",errno); } RETVAL=addr; OUTPUT: RETVAL
  ***********************************************************************
  This seems to run OK with regular c/c++ shared libs like libstdc++.sl. But I have a created a lib "trouble.sl" that just gives me an error.
  However, the shl_load command can load this "trouble.sl" when I use it in C++ code.
  ******************************************************** #include <errno.h> #include <dl.h>
  main(){
  shl_t addr= shl_load("trouble.sl",BIND_DEFERRED, (long)0); printf("shl_load(): return value = %d\n", (int)addr); if (addr ==NULL) { printf("errno = %d\n",errno); }
  *IMPORTANT****: a.out got from the C++ must have its SHLIB_PATH enabled by
  chatr +s enable a.out
  before you can run it. Its on HP unix station.
  I have a feeling this is probably the root of the problem ....
  Anyone with any idea how to get around this problem will be GREATLY APPRECIATED and THANKD by this miserable man.
  Bibek Shrestha
  1. Unable to load Shared libs in PERL
  2. Building Tcl/Tk libs as shared/dynamic loading
  3. Dynamic loading without shared libs?
  4. Q on perl5 build on Linux w/ shared libs
  5. dynamic module creation without shared libs?
  6. new Perl feature request: call into shared libs
  7. Undump and shared libs
  8. calling shared libs
  9. Oracle - OraPerl with shared libs
  10. Shared Libs from XS code
  11. Problem Getting Shared Libs to work (Apha OSF1 V4.0)
  12. Shared Libs with Compiler