Using shared libraries

I've just installed some shared libraries and I'm trying to write some code to access them. The libraries are in /usr/local/lib and the headers are in /usr/local/include .
My C code can find the headers but when I try to compile it I get a load of  "undefined reference to" errors referring to the functions which come from the library. At the end I get
collect2: ld returned 1 exit status
This is when I use gcc as a compiler.
I've ran ldconfig since installing the libraries.
What do I need to do to use the libraries?

I wouldn't do so. There are reason why there are libraries, and you can simply depend on libs (as most things in linux do anyway). If you don't want the deps, and say it's a distributed 1-exe-baby (as oracle) link them statically.
Usually, you can speicfy in the installer where the libs shall go. Also, a .la file is compiled with libtool. I don't know if  you actually can do so, but i'd try to disable libtools (if it's not binary distributed).
Also, you can simply make a pacman packages of the lib with headers, installing the needed things into the path you need it.
If you're a developer, and develop together with other guys, i'd recommend you to create a package, and build up a own local repository, with the devel packages needed. I've done so here, that's really a nice solution, especially for libs installed like this for which you can create nice pacman packages.
// STi

Similar Messages

  • I meet a problem about linking when I use Sharing Libraries.

    I meet a problem when I use Sharing Libraries.
    When I debug my flash on my local end, I can set the URL to "ShareLibrary.swf" (For “Export for runtime sharing”).
    All Files linking the file "ShareLibrary.swf" are working correctly.
    But When I put this swf on the net, the link can't work unless changing the URL to full path including the ip address.
    Is there any way that I can make it work using the same URL, no matter the file is on the local or on the net?

    Morning Alex,
    Thanks for using Apple Support Communities.
    For troubleshooting on this, take a look at this article:
    iPhone: Sound muffled or low from the speaker or when speaking into the mic.
    http://support.apple.com/kb/TS1631
    Resolution
    Check the following:
    Check the volume setting on your iPhone. You can adjust the volume by pressing the volume up and down buttons on the left side of the iPhone.
    If you are using a third-party iPhone case, make sure it is not covering the speaker, microphone, or top microphone. Try making some calls without the case to see if a caller can now hear you more clearly or play music to see if the speaker's volume is better.
    If you have not removed the plastic display film used for protection during shipment, either ensure that the microphone and speaker are not covered or remove the film completely.
    Check that the speaker, microphone mesh covers, and top microphone hole are not clogged with lint or other debris.
    If the speaker, microphone mesh, or top microphone (iPhone 4 only) appear clogged, please use a clean, small, dry, soft-bristled brush to clean them. To do this follow these instructions:
    Use the brush to carefully and gently brush the speaker and microphone mesh.
    Brush away from the 30-pin dock connector to avoid getting any debris into the dock connector.
    Hope this helps,
    Mario

  • Urgent: Can a standalone RA use shared libraries?

    OC4J 10.1.3
    already checked all documents: Developer's Guide, RA Admin Guide, Deployment Guide.... No answer for this.
    I know how to do this for an application (add imported-shared-libraries tag) but this won't work for standalones RAs. I added the tag into orion-ra.xml and tried..
    Thank you!

    Standalone RAs are childs of the default application. Have you already tried to add the import-shared-library tag to the j2ee/home/config/application.xml file ?

  • Using Shared Libraries When Not Logged In

    Is there a way I can use a shared library from my laptop when not logged into my iTunes account on my main computer? It kind of defeats the purpose if I have to have both iTunes running.

    Yes, I'd like to be able to access my shared library from my laptop. I'd like it to function so that my home PC (which has the original library on it) does not have to be running iTunes. For times when I'm logged off or not running iTunes (because it uses a lot of the computer's memory, and other users find it quite annoying).
    I'd just like to know if there are any third-party mods, software, or any other option to perform this task.

  • HPUX shared libraries versions of XML parser v2 for C++

    Hi All,
    Could somebody tell me whether Oracle have any plans to distribute shared versions of the xml libraries that ship with the C++ XML Parser for HPUX.
    I am working on a project that uses shared libraries that in turn use the Oracle XML parser. I have managed to get the final executable to link to the xml static library (the symbols are unresolved when I link the sl, but sort themselves out on the final link) but HP do not recommend mixing static & shared libraries - and my code size increases by quite a bit using this method.
    I would much prefer to use shared libaries as I do when I link the Oracle 8.1.6 libraries.
    Thanks in advance,
    Steve Dalton

    I was able to find out that the XDK libraries on HPUX for Oracle 8.1.7 are built with the +z compiler option (unlike the current versions on OTN for HPUX). So, that will give you position independent code and should allow you to build a shared library.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How do you create a client using static libraries?

    We are trying to create a client that does not use shared libraries.
    We have tried to use a -Bstatic option when linking the libraries but,
    we get the error /usr/local/tuxedo/lib/libtux.a(libtux.so.60): fatal
    error: input shared object in static mode
    We have tried several variations like moving the .a files, changing
    the options around and got no where.
    Any suggestions would be greatly appriciated.
    Thank you.

    Hello,
    If you are using JSF, you can create a LOV by using the selectItem
    component.
    Look at this sample code:
    <h:form binding="#{backing_test.form1}" id="form1">
    <h:selectOneMenu binding="#{backing_test.selectOneMenu1}"
    id="selectOneMenu1">
    <f:selectItem itemLabel="option1" itemValue="1"
    binding="#{backing_test.selectItem1}" id="selectItem1"/>
    <f:selectItem itemLabel="option2" itemValue="2"
    binding="#{backing_test.selectItem2}" id="selectItem2"/>
    <f:selectItem itemLabel="option3" itemValue="3"
    binding="#{backing_test.selectItem3}" id="selectItem3"/>
    </h:selectOneMenu>
    </h:form>
    Regards,
    Luis R.

  • Use of deployment classpath or shared-libraries to pick-up "custom" classes

    Hi,
    I’m trying to determine an approach to dealing with how classes are found in a deployed ADF application via classpath, etc. I’ve tried to explain the situation below as best I can so it’s clear. If you have any comments/suggestions as to how this could be done, it would be much appreciated
    Current Application structure:
    Consists of an application initially deployed to OC4J 10.1.3.4 using an alesco-wss.ear file
    Application contains a single Web Module, initially deployed as wss.war file within the alesco-wss.ear file above.
    The Web Module (wss) was built in JDeveloper 10.1.3.4 using 2 projects, a Model and ViewController project, and uses ADFBC.
    The Model project seems to also generate an alesco-model.jar file in the /WEB-INF/lib/ folder, even though Model classes are in the /WEB-INF/classes/ folder below?
    Exploded structure of application on application server looks something like:
    applications/alesco-wss/META-INF/
    /application.xml <- specifies settings for the Application such as Web Module settings
    /wss/
    /app/ <- directory containing application .jspx pages protected by security
    /images/ <- directory containing application images
    /infrastructure/ <- directory containing .jspx files for login, logout and error reduced security
    /skins/ <- directory containing Skin image, CSS and other files
    /WEB-INF/
    /classes/ <- directory containing application runtime class files as per package sub-directories
    /lib/ <- JAR files used by application (could move some to shared-libaries?) – seems to contain alesco-model.jar
    /regions/ <- directory containing .jspx pages used for Regions within JSPX template page
    /templates/ <- directory containing template .jspx pages used for development (not really required for deployment)
    /adf-faces-config.xml
    /adf-faces-skins.xml
    /faces-config.xml
    /faces-config-backing.xml
    /faces-config-nav.xml
    /region-metadata.xml
    /web.xml
    testpage.jspx <- Publicly accessible page just to test
    The application runs successfully using the above deployment structure.
    We plan to use the exploded deployment structure so that updates to pages, etc. can be applied individually rather than requiring construction and re-deployment of complete .EAR or .JAR files.
    What I’m trying to determine/establish is whether there is a mechanism to cater for a customisation of a class, where such a class would be used instead of the original class, perhaps using a classpath mechanism or shared library?
    For example, say there is a class “talent2.alesco.model.libraries.ModelUtil.class”, this would in the above structure be found under:
    applications/alesco-wss/META-INF/classes/talent2/alesco/model/libraries/ModelUtil.class
    Classes using the above class would import “talent2.alesco.model.libraries.ModelUtil”, so they effectively use that full-reference to the class (talent2.alesco.model.libraries as a path, either expanded or within a JAR).
    From the Oracle Containers for J2EE Developer’s Guide 10.1.3 page 3-17, it lists the following:
    Table 3–1 Configuration Options Affecting Class Visibility
    Classloader Configuration Option
    Configured shared library <code-source> in server.xml
    <import-shared-library> in server.xml
    app-name.root <import-shared-library> in orion-application.xml
    <library> jars/directories in orion-application.xml
    <ejb> JARs in orion-application.xml
    RAR file: all JARs at the root.
    RAR file: <native-library> directory paths.
    Manifest Class-Path of above JARs
    app-name.web.web-mod-name WAR file: Manifest Class-Path
    WAR file: WEB-INF/classes
    WAR file: WEB-INF/lib/ all JARs
    <classpath> jars/directories in orion-web.xml
    Manifest Class-Path of above jars.
    search-local-classes-first attribute in orion-web.xml
    Shared libraries are inherited from the app root.
    We have reasons why we prefer not to use .JAR files for these “non-standard” or “replaced” classes, so prefer an option that doesn’t involve creating a .JAR file.
    Our ideal solution would be to have such classes placed in an alternate directory that is referred to in a classpath such that IF a class exists in that location, it will be used instead of the one in the WEB-INF/classes/ directories, and if not such class is found it would then locate it in the WEB-INF/classes/ directories.
    - Can a classpath be set to look for such classes in a directory?
    - Do the classes have to replicate the original package directory structure within that directory (<dir>/talent2/alesco/model/libraries)?
    - If the class were put in such a directory, without replicating the original package directory structure, I assume the referencing “import” statements would not locate it correctly.
    - Is the classpath mechanism “clever” enough to search the package directory structure to locate the class (i.e. just points to <dir>)?
    - Or would the classpath mechanism require each individual path replicating the package structure to be added (i.e. <dir>/talent2/alesco/model/libraries/ and any other such package path)?
    If we are “forced” to resort to the use of JAR files, does a JAR file used for the purpose of overwrite/extending a sub-set of classes in the original location need to contain ALL related package classes? Or does it effectively “superset” classes it finds in all JAR files, etc. in the whole classpath? That is, it finds talent2.alesco.model.libraries.ModelUtil in the custom.jar file and happily goes on to get the remainder of talent2.alesco.model.libraries classes in the other core JAR/location. Or does it need all of them to be in the first JAR file for that package?
    Any help would be appreciated to understand how these various class visibility mechanisms could be used to achieve what is required would be appreciated.
    Gene

    So, nobody's had any experience with deploying an ADF application, and providing a means for a client to place custom classes in such a way as they're used in preference to the standard application class, effectively to implement a customised class without overwriting the original "standard" class?
    Gene

  • Implementation of Shared Libraries on Palm Using J2ME

    Hi,
    I am currently working on the Palm Shared Libraries using C...Kind of drag....so I wonder is there any way to implement this on the Palm using J2ME...
    Thanks and Regards,
    Joseph

    From memory, I dont think that J2ME provides a an implementations at the moment that can access the Palm shared libraries, it's too specific for the generic implementation of MIDP, although I've heard of a PDA profile that SUN is working on, may or may not be true , but it's worth checking out : )
    Vance

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Using Shared Object Libraries

    How (or what) do we set when using shared object libraries?
    We have Java Native Methods which are implemented using C++ and stored in shared object libraries. We can build our project, but when trying to execute the project, the shared object libraries are not found. We had tried to set the external execution settings to include the library paths, but nothing seems to take affect.
    What do we need to set to run with the shared object libraries?

    RK,
    I appreciate your responce, hopefully we'll get this worked out. I will try to give you as much information as I can so you will hopefully understand the problem.
    We have added a Library Reference to our project - which is a jar file - this jar file contains our Business Objects which are implemented in Java. Within this Library Reference, there is a Java class which has a Native method. The method is implemented in C++ The C++ implementation of this method is within a C++ shared object library (libname.so).
    How do we let Creator know that we need to link in this C++ Shared Object Library at run time?
    The Modifers Properties for the method in the library reference are correctly set - that is they are set to Native. For a method within a java element, selecting or un-selecting this modifier simply changes the method declaration. It does not tell Creator where the actual implementation is (shared object library in this case).
    As originally stated, we tried to include our shared object library in the Execution Property of the properties window for the Java Element. Here is what we have done so far - all unsuccessful....
    Under the External Execution Property - we added the environment variable LD_LIBRARY_PATH set to our shared object library path. We also selected the Append Environment Variable (set to true). We are not able to modify the Library Path of the External Execution Property - it will not allow changes - all buttons are disabled in the pop up window.
    There are no properties for the Internal Execution within the Executor Properties, so there is nothing we can set there.
    We have tried to set the Debugger Execution properties in the same manner as the External Execution properties to run the project in Debug mode - and have the same problem - while executing the project, we get the error message which indicates that our shared object library can not be found.
    There are no property settings available on the J2EE Server Execution Properties to set.
    What do we need to set so that this Shared Object Library will be located during execution of our project under SJSC?
    Thank you for any suggestions you may have.
    --Scott                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • OC4J 10.1.3 Shared Libraries -- legal use of library-compatible attribute?

    I notice that several seeded shared libraries set the library-compatible attribute to allow arbitrary java archives to be picked up from an included code-source location that is a plain directory (i.e. not an explicity java archive reference).
    As one solution to a BPEL/WSIF/Java Binding configuration that I'm working on, adding library-compatible="true" to oracle.bpel.common allowed me to easily deploy JARs that are accessible to the BPEL WSIF framework at runtime (i.e. you can then put your JARs in $ORACLE_HOME/bpel/system/classes and they will be found by the specific loader).
    Question: OC4J documentation says that the library-compatible attribute is internal use only and also doesn't describe all its possible effects (besides the convenient one above). What's the scoop on this shared-library attribute?
    Thanks,
    Todd

    I notice that several seeded shared libraries set the library-compatible attribute to allow arbitrary java archives to be picked up from an included code-source location that is a plain directory (i.e. not an explicity java archive reference).
    As one solution to a BPEL/WSIF/Java Binding configuration that I'm working on, adding library-compatible="true" to oracle.bpel.common allowed me to easily deploy JARs that are accessible to the BPEL WSIF framework at runtime (i.e. you can then put your JARs in $ORACLE_HOME/bpel/system/classes and they will be found by the specific loader).
    Question: OC4J documentation says that the library-compatible attribute is internal use only and also doesn't describe all its possible effects (besides the convenient one above). What's the scoop on this shared-library attribute?
    Thanks,
    Todd

  • How do I import music using homeshare with iTunes 11...I can see the shared libraries but I can't drag and drop and there is no import button.  Thanks!

    How do I import music using homeshare with iTunes 11...I can see the shared libraries but I can't drag and drop and there is no import button.  Thanks!

    Yes, that appears how Mavericks works right now. However, you can open the Address Panel, select all your contacts, then click the To (or CC, or Bcc) buttons to move the selection to the address field.
    If it is not already in the Toolbar, right-click on the Toolbar and select Customize Toolbar…
    Then, drag the address panel up to wherever you want it.
    You may also want to add it to the New Message window in the same way.

  • 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.

  • Pacman uses the wrong shared libraries

    Hi!
    I had had MCR's path in the PATH. Since then pacman uses (or at least it tries to) the shared libraries found in MCR's path. It causes errors like this:
    pacman: /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4: no version information available (required by /usr/lib/libalpm.so.8
    The output of 'ldd $(which pacman)':
    /usr/bin/pacman: /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4: no version information available (required by /usr/lib/libalpm.so.8)
    linux-vdso.so.1 (0x00007fff709fc000)
    libalpm.so.8 => /usr/lib/libalpm.so.8 (0x00007f56f80ad000)
    libarchive.so.13 => /usr/lib/libarchive.so.13 (0x00007f56f7e0a000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f56f7a67000)
    libgpgme.so.11 => /usr/lib/libgpgme.so.11 (0x00007f56f782e000)
    libcurl.so.4 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4 (0x00007f56f75e7000)
    libcrypto.so.1.0.0 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcrypto.so.1.0.0 (0x00007f56f7205000)
    libacl.so.1 => /usr/lib/libacl.so.1 (0x00007f56f6ffc000)
    libattr.so.1 => /usr/lib/libattr.so.1 (0x00007f56f6df7000)
    libexpat.so.1 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libexpat.so.1 (0x00007f56f6bcf000)
    liblzo2.so.2 => /usr/lib/liblzo2.so.2 (0x00007f56f69ad000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f56f678a000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f56f657a000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f56f6364000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f56f82dd000)
    libassuan.so.0 => /usr/lib/libassuan.so.0 (0x00007f56f6153000)
    libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f56f5f41000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f56f5d25000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f56f5b21000)
    How can I get pacman to use the proper libraries?
    Last edited by labuwx (2014-10-06 15:59:47)

    labuwx wrote:
    I had had MCR's path in the PATH. Since then pacman uses (or at least it tries to) the shared libraries found in MCR's path. It causes errors like this:
    How can I get pacman to use the proper libraries?
    presumably, there's your problem remove it from the PATH and your problems will likely vanish.
    you should install it following the wiki page

  • Sharing Libraries across accounts on one computer

    I'd like to know an easy method to share iPhoto libraries across accounts on one computer. It looks like iPhoto is more or less ignoring this topic. I have searched the web for tips, found some, yet the instructions are complicated and what seemed to be the best one didn't work. Anyone in this forum that can help me?

    haha, brian has a hidden message in there.
    Anyway, here all the links I have for sharing. The last link for using ACLs is the one I think you are thinking of.
    SHARING IPHOTO LIBRARIES
    Sharing libraries between users on the same local network
    You can also share a library on the same machine between users the same way.
    Sharing libraries between users on the same machine...
    -both users must have sharing enabled in their iPhoto Preferences
    -both users must be logged in and have iPhoto running
    -Remember that you can only view the other library. You can't edit the photos or play the saved slideshows or view the made books or burn them to CD or DVD. The books and slideshows will show up as an album. You can play that album as an "on the fly" slideshow. You can drag images from the sharing library to your library in the source column to import them to your library. You can then edit, add to albums, books, slideshow, etc.
    Sharing links from Apple....
    Sharing your photos between computers
    About shared photos
    Turning off photo sharing
    Looking for shared photos
    SHARING ONE IPHOTO LIBRARY BETWEEN USERS ON SAME MACHINE
    You can try one of these three methods:
    1- Use iPhoto Library Manager-the paid version
    The documentation page will give instructions on how it is done.
    2- Sharing one iPhoto library between several users on one machine
    3- Share an iPhoto Library in tiger Using ACL's

Maybe you are looking for