Building shared libraries on linux with SunStudio

Hi,
I installed the sunstudio-compilers on my system (SuSE 10.0/x86-64) and try to build a shared library.
For my (c++-)library I use autoconf/automake, so I hoped it to be trouble-free, but it is not. I configured my library with:
./configure CC=cc CXX=CC CFLAGS=-fast CXXFLAGS=-fast -D_GNU_SOURCE(I needed this -D_GNU_SOURCE to have pthread_rwlock_*).
The compiler run fine, but the linker does not produce any output. I guess the command, which should have created the library is:
/bin/sh ../libtool --tag=CXX --mode=link CC  -fast -D_GNU_SOURCE   -o libcxxtools.la -rpath /usr/local/lib -lpthread -version-info 3:1:0 base64stream.lo cgi.lo dlloader.lo hdstream.lo hirestime.lo httpreply.lo httprequest.lo iniclass.lo log.lo md5.lo md5stream.lo multifstream.lo net.lo pollclass.lo query_params.lo tcpstream.lo tee.lo thread.lo udp.lo udpstream.lo xmltag.lo iconvstream.lo  ../libltdl/libltdlc.la  -lnslIt creates a src/libcxxtools.la and symbolic links src/.libs/libcxxtools.so and src/.libs/libcxxtools.so.3, but no shared library src/.libs/libcxxtools.so.3.0.1, where the links point to. Is there any chance to get automake running with sunstudio?

libtool problem is that it has embedded knowledge about compiler options, and it is platform-dependant.
libtool knows that it should use -G to link shared library with SunStudio on Solaris.
It has no clue about existance of SunStudio on Linux.
Anyway, if you are compiling with SunStudio you should always link with SunStudio (cc, CC or f90).
Thus proper configure line should include LD=CC for C++, LD=cc for C programs.
If you use default linker (ld) it will fail to resolve dependancies specific to SunStudio compiler.
Thats what happens in your case.
However even if you specify LD=CC it will not do shared libraries for the cause mentioned about - when configuring libtool tries to figure out how to build shared library and deciding not to build it at all.
You can get out with LD=cc (as our cc driver supports gnu-style -shared option).
Though you will have to specify all the SunStudio C++-specific link dependancies manually.
Another option is to modify libtool script. Which version do you use?
regards,
__Fedor.

Similar Messages

  • How to use g++ to build shared libraries for labview in linux?

    does anyone knows if it's possible to compile a shared library in linux with g++ that could be recognized by labview?
    thks
    JP

    Hi JP,
    Yes you can use g++ to build shared libraries that labview can use. You'll want to give your C++ library a C interface. This is really common practice. You can do this by simply declaring functions as 'extern "C"'. Here is a link with more information:
    http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-30.8
    I've personally worked on projects that do exactly what you want to do.

  • Error while loading shared libraries libnnz10.so with brconnect

    Hi
    I am experiencing some problems within an installation, brconnect seems to be looking for oracle 10 libraries? while my oracle is a 9.2 !
    these are the logs:
    ERROR CJS-00288  Could not update database statistics.<br>DIAGNOSIS: Command brconnect -u / -c -f crsyn -o SAPXID returned 127.<br>SOLUTION: See brconnect.log for details.
    brconnect.log:
    Execution of the command "/sapmnt/XIE/exe/brconnect -u / -c -f crsyn -o SAPXID" finished with return code 127. Output:
    /sapmnt/XIE/exe/brconnect: error while loading shared libraries: libnnz10.so: cannot open shared object file: No such file or directory
    Yes, that's true, libnnz10.so does not exist, it happened something similar with the library libclntsh.so.10.1, I only have a libclntsh.so, with a softlink from libclntsh.so.9.
    maybe the brtools imagine I have an oracle 10?
    I specified a 9.2 Oracle during the installation!
    Many thanks, Mario.

    >
    Tecnica de Sistemas wrote:
    > I am experiencing some problems within an installation, brconnect seems to be looking for oracle 10 libraries? while my oracle is a 9.2 !
    > [...]
    > I specified a 9.2 Oracle during the installation!
    Installation of what?
    Clearly the BRTOOLS are version 700, so, even when you specified that Oracle 9i was to be installed the BRTOOLS delivered are the mentioned version and you
    must install the oracle 10g instant client or
    replace the version 700 by version 640
    Regards

  • Setting Shared Libraries on Websphere with JMX

    Hello,
    I need to configure the Websphere "Shared Libraries" with java code, like JMX.
    Can anyone give me a snippet for that ?
    Thanks !

    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!
    Try a Coke-a-Cola ther good!

  • Building Shared Libraries: Python Extension Using C++ and SWIG

    I am working through the tutorial examples from http://www.swig.org/ and have run into some problems. I took the following command instructions from the tutorial on swig.org:
    http://www.swig.org/tutorial.html
    I have written example.c and example.i as described in the above tutorial. My first attempt at compiling the libraries was this:
    swig -python example.i
    gcc -c example.c example_wrap.c \
    -I /System/Library/Frameworks/Python.framework/Versions/Current/Headers
    ld -shared example.o example_wrap.o -o _example.so
    this last command fails with the following error:
    ld: unknown option: -shared
    Any help?

    Hi, newbie73
    I'm also running into trouble with manually linking and creating .so objects using swig.
    The good news is, for python there's a shortcut, using the distutils module. Using the example.c and example.i codes from the tutorial, make a python script called 'setup.py':
    <pre>
    from distutils.core import setup, Extension
    setup(name='example',
    version='1.0',
    ext_modules = [
    Extension('example', ['example.c','example.i'] )
    </pre>
    edit: The discussion markup is messing up this code snippet: line 5 should read:
    Extension('example', LEFT BRACKET 'example.c' , 'example.i' ] )
    Then run:
    python setup.py build_ext
    Python will do the compiling and linking for you, and create an example.so file inside a new 'build' directory. To use the .so file, move or rename this file to _example.so in your $PYTHONPATH.
    (By the way, I found this information in the excellent textbook Beginning Python by M. Hetland)
    I hope that helps!
    Caleb
    Message was edited by: Caleb Mattoon

  • Troubles with shared libraries

    I have some problems with shared libraries. This is the partial result of a ./configure
    checking if libtool supports shared libraries... no
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes
    checking for ld used by g++... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... no
    checking for g++ option to produce PIC... -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... no
    checking dynamic linker characteristics... no
    Why libtool and the g++ linker don't support shared libraries?
    Searching in the forum i saw other people having a positive answer to the checks. Did i make something wrong?
    Thanks.

    "This is the partial result of a ./configure" - of *what* app? Look at the configure script that you're running.

  • Using sunperf in shared libraries

    Hi,
    I would like to support sunperf in one software project which uses cblas. The code using cblas is a dynamically loadable library (python module). My problem is that using -xlic_lib=sunperf does not work when building shared libraries. More concretely:
    file: floupi.c
    enum CBLAS_ORDER { CblasRowMajor = 101, CblasColMajor = 102 };
    enum CBLAS_TRANSPOSE { CblasNoTrans = 111, CblasTrans =
         112, CblasConjTrans = 113 };
    void cblas_sgemm(const enum CBLAS_ORDER Order,
              const enum CBLAS_TRANSPOSE TransA,
              const enum CBLAS_TRANSPOSE TransB, const int M,
              const int N, const int K, const float alpha,
              const float A, const int lda, const float B,
              const int ldb, const float beta, float *C, const int ldc);
    int main(void)
    int lda = 3;
    float A[] = { 1, 2, 3,
         4, 5, 6
    int ldb = 2;
    float B[] = { 1, 2,
         3, 4,
         5, 6
    int ldc = 2;
    float C[] = { 0.00, 0.00,
         0.00, 0.00
    /* Compute C = A B */
    cblas_sgemm(CblasRowMajor,
              CblasNoTrans, CblasNoTrans, 2, 2, 3,
              1.0, A, lda, B, ldb, 0.0, C, ldc);
    return 0;
    This can be compiled easily using cc floupi.c -xlic_lib=sunperf; the executable works as expected. Now, let's say that instead of main, I use another symbol, to compile the code as a shared library:
    cc -G floupi.c -xlic_lib=sunperf
    Then the built shared library has the cblas_sgemm undefined (according to nm), and ldd shows that libsunperf is not linked. This of course means that for my python module, I have an error with undefined symbols when I try to import it. Why is sunperf not linked at all for shared libraries ? The problem appears both on solaris studio express on x86 and on linux x86 (sunstudio 12 in both cases).
    I also noticed that if instead, I use
    cc -G floupi.c -lsunperf
    Then it seems that cblas_sgemm is not undefined anymore (according to nm), but this looks like linking the cblas_sgemm statically, which is not what I want.
    Thanks,
    David

    I finally found the verbose option for suncc (-#), and this confirms what the above suggested, that is when -G is used, sunperf is not linked:
    ### Note: LD_LIBRARY_PATH = /home/david/local/intel/cc/9.1.042/lib:/home/david/opt/intel/fc/10.0.023//lib:/home/david/opt/intel/cc/10.0.023//lib:/home/david/local/lib:
    ### Note: LD_RUN_PATH = <null>
    /usr/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 --enable-new-dtags /home/david/opt/sun/sunstudio12/prod/lib/crti.o /home/david/opt/sun/sunstudio12/prod/lib/values-xa.o -shared floupi.o -Y "/home/david/opt/sun/sunstudio12/prod/lib:/lib:/usr/lib" -Qy -lc /home/david/opt/sun/sunstudio12/prod/lib/libc_supp.a /home/david/opt/sun/sunstudio12/prod/lib/crtn.o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Building shared library

    I am a new user to Mac and I am trying to build a shared library using gcc. However, I am getting errors when creating a execuatble.
    My system info. is:
    [email protected] <810> gcc --version
    i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)
    [email protected] <811> uname -a
    Darwin foxtrot.vni.com 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PD
    T 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386
    Here is a small example for the problem.
    ========= kk.h ===========
    #include<stdio.h>
    #include<math.h>
    void sub();
    =========== sub.c =========
    #include "kk.h"
    void sub() {
    printf("sub = %g\n", fabs(-2.0));
    ======== main.c ========
    #include "kk.h"
    main() {
    sub();
    =====================
    [email protected] <792> gcc -c -fPIC sub.c
    [email protected] <793> gcc -o libkk.so -dynamic -r sub.o
    [email protected] <794> gcc main.c libkk.so -lm
    /usr/bin/ld: multiple definitions of symbol _NXArgc
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _NXArgc in section (_DATA,_data)
    libkk.so definition of _NXArgc in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _NXArgv
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _NXArgv in section (_DATA,_data)
    libkk.so definition of _NXArgv in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _progname
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _progname in section (_DATA,_data)
    libkk.so definition of _progname in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol _environ
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of _environ in section (_DATA,_data)
    libkk.so definition of _environ in section (_DATA,_data)
    /usr/bin/ld: multiple definitions of symbol start
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o definition of start in section (_TEXT,_text)
    libkk.so definition of start in section (_TEXT,_text)
    collect2: ld returned 1 exit status
    Thank you.

    Hi Gschwert,
    our developers told me that for X-Code Version 4 you need an additional download. Then, it should also work with Version 4. Here is what they said:
    It turned out that Shared Libraries compile fine with XCode 4, it's just that the command line tools that we need for compilation are now an optional download. 
    From https://developer.apple.com/xcode/ 
    "Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators." 
    So, this is not well documented we will handle that and let make a correction as soon as possible.
    Have a nice day,
    Abduelkerim
    Sales
    NI Germany

  • Building Shared Object for LabView

    All;
    I'm trying to build a C++-based shared object to be called from LabView and use SunCC instead of gcc. The compile stage looks like:danny@traveler:~/tubes/dielectric/rod_software/lookup> make -f Makefile.unix suncc=1
    sunCC -I/usr/local/lv71/cintools -I/home/danny/src/NR_C301/code -c -KPIC -m32 -Di686 lookup.cc
    "/home/danny/src/NR_C301/code/interp_1d.h", line 183: Warning: n hides Base_interp::n.
    "/home/danny/src/NR_C301/code/mins_ndim.h", line 103: Warning: n hides Linemethod<extern "C" double(const NRvector<double>&)>::n.
    "lookup.cc", line 176:     Where: While instantiating "Powell<extern "C" double(const NRvector<double>&)>::minimize(const NRvector<double>&)".
    "lookup.cc", line 176:     Where: Instantiated from non-template code.
    2 Warning(s) detected.and the load stage fails like this:sunCC -G -m32 -o lookup.so lookup.o /usr/local/lv71/AppLibs/liblvrt.so.7.1 /usr/lib/libGL.so /usr/lib/libOSMesa.so.6
    /opt/sun/sunstudio12/prod/lib/crtn.o:(.text+0x0): multiple definition of `_etext'
    make: *** [lookup.so] Error 1Is my problem obvious? Is there a simple example on how to build SOs? I found the switch definitions in the Sun documentation, but no good examples yet.
    ...Dan

    If your library links to other shared libraries, use -L options to point to directories other than system directories, and the -l option for the library name after "lib".
    When building shared libraries, you also need to list all system libraries explicity, unfortunately, to ensure your library has the right dependencies.
    You should also add -zdefs to force the linker to complain about unresolved symbols. The default when building shared libraries is not to warn about them.
    You want to be sure you have included all the needed libraries in the link.
    Your link command should look like this :
    sunCC -G -m32 -o lookup.so lookup.o -zdefs \
      -L /usr/local/lv71/AppLibs -llvrt.so.7.1 -lGL.so -lOSMesa.so.6 -lCstd -lCrun -lm -lcYou don't need a -L option for /usr/lib or the directories in the Sun Studio installation. The CC driver knows where to find system libraries.
    That said, I don't think the command line issues are the cause of the multiple definition error.
    Binaries created by Sun C++ are not compatible with binaries created by other C++ compilers like g++. Is liblvrt.so.7.1 a g++ library?

  • Linux JVM: How to load shared libraries with mutual/circular dependencies

    Hi,
    I am using the API
    System.loadLibrary(String name)
    to dynamically link shared libaries to Linux JVM.
    The shared libraries has complex circular symbol dependencies among them.
    I am not able to load shared libraries due to java.lang.UnsatisfiedLinkError.
    Any ideas on how a number of shared libraries with interdependent realtionships
    could be successfully linked in to the Linux JVM?
    Thanks,
    Soumen.
    Background
    ===========
    Successful execution of native code within Java virtual machine in a
    host platform, has two necessary prerequisites:
    Prerequisite 1: The native code is written to the JNI specification
    Prerequisite 2: The native code is dynamically linked with Java virtual
    machine.
    The second step is achieved via simple Java interface, System.loadLibrary:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#loadLibrary(java.lang.String)
    However, implementation of this interface is highly platform dependent
    in regards to exact nature of dynamic linking process.
    Tests
    =====
    I made three shared libraries libfeatureA.so, libfeatureB.so and libfeatureC.so.
    Feature A and Feature B are mutually dependent on each other (i.e cicular
    dependencies between libfeatureA.so, libfeatureB.so) whereas libfeatureC.so
    has no external dependencies.
    Case 1
    I could link libfeatureC.so with java.
    Case 2
    Java failed to resolve circular dependency between libfeatureA.so, libfeatureB.so
    resulting in linking failure. There may be repackaging workarounds which I have
    not yet explored.
    Java source code
    ================
    class TestLoadLibrary
    static
    System.loadLibrary("featureB");
    System.loadLibrary("featureA");
    System.loadLibrary("featureB");
    public static void main(String[] args)
    System.out.println("In TestLoadLibrary.main()");
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /homes/soumen/work/event/featureB/libfeatureB.so.1.0: /homes/soumen/work/ev B.so.1.0: undefined symbol: featureA_func2
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1737)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1662)
    at java.lang.Runtime.loadLibrary0(Runtime.java:817)
    at java.lang.System.loadLibrary(System.java:986)
    at TestLoadLibrary.<clinit>(TestLoadLibrary.java:5)

    The use of "dlopen() application programming" to achieve dynamic link closure works if there are
    no circular dependencies. For example, I have the following dependency:
    libfeatureD.so ==> libfeatureC.so
    Even if I call Java APIs in correct dependency order, i.e.,
    System.loadLibrary("featureC");
    System.loadLibrary("featureD");
    there would be java.lang.UnsatisfiedLinkError for call System.loadLibrary("featureD").
    Now, I have a JNI method implementation, which makes native API call in same dependency order:
    dlopen("libfeatureC.so", RTLD_LAZY|RTLD_GLOBAL);
    dlopen("libfeatureD.so", RTLD_LAZY|RTLD_GLOBAL);
    and now System.loadLibrary calls succeed. Note that I had to set environment
    variable LD_LIBRARY_PATH so that dlopen call would find libraries to load.
    In other words, from a JNI programming point of view, "linking chasm" has been crossed.
    I am looking at circular dependency issue, i.e.,
    libfeatureA.so <==> libfeatureB.so
    There may be library repackaging workaround.
    If anybody knows any workaround, please post.
    -Soumen Sarkar
    JNI code
    ========
    #include <jni.h>
    #include "TestLoadLibrary.h"
    #include <stdio.h>
    #include <string.h>
    #include <dlfcn.h>
    JNIEXPORT void JNICALL Java_TestLoadLibrary_libLoadNative
    (JNIEnv * jenv, jclass class, jobjectArray libNames)
    printf("native: In TestLoadLibrary.libLoadNative()\n");
    char linuxLibName[1024];
    jsize idx = 0;
    jsize nLibs = (*jenv)->GetArrayLength(jenv, libNames);
    for(idx = 0; idx < nLibs; ++idx)
    /* obtain the current object from the object array */
    jobject myObject = (*jenv)->GetObjectArrayElement(jenv, libNames, idx);
    /* Convert the object just obtained into a String */
    const char libName = (jenv)->GetStringUTFChars(jenv,myObject,0);
    strcpy(linuxLibName, "lib");
    strcat(linuxLibName, libName);
    strcat(linuxLibName, ".so");
    printf("\nnative: Trying to open lib with name %s\n", linuxLibName);
    void* handle = dlopen(linuxLibName, RTLD_LAZY|RTLD_GLOBAL);
    if(handle == 0)
    fputs ("\nnative: Could not load lib\n", stderr);
    fputs (dlerror(), stderr);
    else
    printf("\nnative: Loaded lib %s\n", linuxLibName);
    /* Free up memory to prevent memory leaks */
    (*jenv)->ReleaseStringUTFChars(jenv, myObject, libName);
    return;

  • Installing flashplayer 11 on Linux 64 bit - error while loading shared libraries: libX11.so.6

    I've downloaded the flashplayer_11_sa_debug.i386.tar.gz file and extracted it on my RHEL box. When I run ./flashplayerdebugger I get the following error:
    ./flashplayerdebugger: error while loading shared libraries: libX11.so.6: wrong ELF class: ELFCLASS64
    This lib is found in /usr/lib64/libX11.so.6 on this machine.
    It is my understanding that flashplayer has native 64 bit support on Linux and therefore should be compatible with lib64 libaries, so why I am I seeing this error? I've been told it's because it's a 32 bit version of the player....
    I also see this error if I install the flashplayer_11_sa.i386.tar.gz projector instead of the debugger version.
    There don't seem to be any specific 64bit versions of the flashplayer from the download page: http://www.adobe.com/support/flashplayer/downloads.html, yet there seem to be beta releases of a 64 bit Linux player which are no longer available.
    Can anyone help me with this? Where can I get a 64bit v11 flashplayer for Linux?
    Thanks

    Hi MurrayFurtado,
    The builds you are attempting to download from that page are the 32-bit content debuggers and standalone players.  To download the 64-bit players go to http://get.adobe.com/flashplayer (or get.adobe.com/flashplayer/otherversions).
    Since you didn't specify which version of RHEL you have, FP 11 is supported on RHEL 5.6 or later (http://www.adobe.com/products/flashplayer/tech-specs.html).
    Maria

  • Unable to install JRun on Linux receive error while loading shared libraries

    I'm installing JRun trial version on Ubuntu with java version
    "1.6.0_07". I receive the following errors when I install:
    guest:~/Desktop$ sh ./jrun-40-linux-en.bin -i gui
    Preparing to install...
    Extracting the installation resources from the installer
    archive...
    Configuring the installer for this system's environment...
    dirname: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    /bin/ls: error while loading shared libraries: librt.so.1:
    cannot open shared object file: No such file or directory
    basename: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    dirname: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    basename: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    Launching installer...
    rm: error while loading shared libraries: libc.so.6: cannot
    open shared object file: No such file or directory
    rm: error while loading shared libraries: libc.so.6: cannot
    open shared object file: No such file or directory

    I get that error too when try to install Jrun 4.0 on Open
    Suse 11.0, Can anyone show me how to solve that problem.

  • Shared development directory with shared libraries

    Is there a way to use the .beabuild.txt format with things other than EARs? I've got some java and web shared libraries, and I'd like to take advantage of this feature to enable rapid development of these entities.

    Dird wrote:
    Hi guys,
    I need to link to files on a shared directory (Windows based) within some APEX pages (Linux based). Anyone done this process before? How would I do it? I've tried the following:file:///J:/dir/dir/file.doc
    file:///hostname/dir/dir/file.doc
    /i/file.doc  and #IMAGE_PREFIX#file.doc  // copied file to the linux images directory to testBut none of the following allows you to access the file (nothing pops up). All users have it mapped to the J: drive on their local machine. Offsite access isn't required.Browser? Version?
    Basically file:http:security on most modern browsers won't allow you to access <tt>file:</tt> scheme URLs from an <tt>http:</tt> scheme site. Doing so is seen as a violation of the same origin policy.
    Locate the file in the database or on a web server file system and access it using <tt>http:</tt>.

  • Install RAC failed with root.sh error while loading shared libraries: libst

    Hi ,
    I install rac under vmware workstation using this atricle .
    http://www.oracle-base.com/articles/10g/OracleDB10gR2RACInstallationOnCentos4UsingVMware.php
    everything work smoothly but I faced error with root.sh
    Failed to upgrade Oracle Cluster Registry configuration
    I found metlalink talk about missing compat-libstdc++-33-3.2.3-47.3.ia64.rpm and must be installed according to
    that .
    The probelm rasied when run
    /u01/app/oracle/product/10.2.0/crs/bin/crsctl.bin: error while loading shared libraries: libstdc++.so.5: cannot
    open shared object file: No such file or directory
    Failure initializing entries in /etc/oracle/scls_scr/rac2.
    Linux version is RHE4
    [oracle@rac1 bin]$ uname -a
    Linux rac1.localdomain 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
    when install this package it does not work
    [root@rac1 RPMS]# rpm -Uvh compat-libstdc++-33-3.2.3-47.3.ia64.rpm
    warning: compat-libstdc++-33-3.2.3-47.3.ia64.rpm: V3 DSA signature: NOKEY, key ID b38a8516error: Failed
    dependencies:
    libc.so.6.1()(64bit) is needed by compat-libstdc++-33-3.2.3-47.3.ia64 libc.so.6.1(GLIBC_2.2)(64bit)
    is needed by compat-libstdc++-33-3.2.3-47.3.ia64 libc.so.6.1(GLIBC_2.3)(64bit) is needed by compat-
    libstdc++-33-3.2.3-47.3.ia64 libgcc_s.so.1()(64bit) is needed by compat-libstdc++-33-3.2.3-47.3.ia64
    libgcc_s.so.1(GCC_3.0)(64bit) is needed by compat-libstdc++-33-3.2.3-47.3.ia64 libgcc_s.so.1(GCC_3.3)(64bit)
    is needed by compat-libstdc++-33-3.2.3-47.3.ia64 libgcc_s.so.1(GLIBC_2.0)(64bit) is needed by compat-
    libstdc++-33-3.2.3-47.3.ia64 libm.so.6.1()(64bit) is needed by compat-libstdc++-33-3.2.3-47.3.ia64
    compat-libstdc++ = 7.3-2.96.128 is needed by (installed) compat-libstdc++-devel-7.3-2.96.128.i386 compat-
    libstdc++ = 7.3 is needed by (installed) compat-gcc-c++-7.3-2.96.128.i386[root@rac1 RPMS]#
    My probelm cannot install this packages ? What shoudl I do .

    user12010537 wrote:
    Hi ,
    I found metlalink talk about missing compat-libstdc++-33-3.2.3-47.3.ia64.rpm and must be installed according to
    Linux version is RHE4
    [root@rac1 RPMS]# rpm -Uvh compat-libstdc++-33-3.2.3-47.3.ia64.rpm
    warning: compat-libstdc++-33-3.2.3-47.3.ia64.rpm: V3 DSA signature: NOKEY, key ID b38a8516error: Failed
    dependencies:
    libc.so.6.1()(64bit) is needed by compat-libstdc++-33-3.2.3-47.3.ia64
    My probelm cannot install this packages ? What shoudl I do .
    Hi,
    You need to install the dependency package first like glibc, etc
    also see the output from runcluvfy, it should show which packages need to installed
    Cheers

  • Help with Shared Libraries?

    I don't have a "Look for Shared Libraries" under Preferences >  Sharing (which the other two computers in my home do have), all I have is the  "Shared Libraries" under Preferences > General > Sources (which  this is checked).  I have uninstalled iTunes and then installed it again, this did not work.  The other two computers in my home are running off of Windows XP, but the trouble computer is running off of Windows Vista.  Not sure if this could be the problem. Please help.

    krysto wrote:Yes, I have used pacman before to install software, but what if I want to contribute to the development of a project?
    Usually when you are developing software you don't install the package every time you compile it. You just make sure that you can run it from the location where you compiled it. That way you can keep the latest stable version that you can use for leisure time and the development version for testing. Also for contributing to a project you should directly interact with the project's repository (svn, git, ...). So I refer back to my first post here where the PKGBUILD can give you an idea how to go about compiling the source code yourself.
    Just don't run "make install" because that will leave your system in a messy state, a simple "make" (with the proper configuration) should result in a locally build binary that you can run from where it was compiled.

Maybe you are looking for