Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

G++ Shared Library Issues

  1. May 14, 2013 #1
    Before I switched to Opensuse 12.3, I was running Arch, and doing something like:
    Code (Text):
    g++ -o test -I ./include/ -L ./lib/ -ltcod -ltcodxx ./src/main.cpp
    with no problems occuring.

    Now, when I try to do that (with everything kept the exact same as when on Arch), I get:
    Code (Text):
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible lib/libtcod.so when searching for -ltcod
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -ltcod
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible lib/libtcodxx.so when searching for -ltcodxx
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -ltcodxx
    I also tried including -Wl,-rpath=./lib/ , but it still made no difference.

    Any help as to why the libraries have become incompatible all of a sudden would be greatly appreciated.
  2. jcsd
  3. May 14, 2013 #2


    Staff: Mentor

  4. May 14, 2013 #3
    Also, is there the possibility of an issue of static vs dynamic libraries? I seem to remember a problem along those lines when. at the office, I got switched from Red Hat 4 to Red Hat 5.
  5. May 14, 2013 #4


    Staff: Mentor

  6. May 15, 2013 #5
    I guess.

    By the way, the error message posted does not quite say that the library was not found, it says that what was found is not compatible...whatever that means...different compiler? different size (32 vs 64)? different something? Sorry, I am no expert on these matters.
  7. May 26, 2013 #6


    User Avatar
    Gold Member

    The term "shared libraries" may refer to libraries that are either static OR dynamic. Static libraries are compiled right into your executable, whereas dynamic libraries are linked at runtime.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Shared Library Issues Date
C/++/# Buffer sharing Nov 17, 2017
Risk Index for Shared Components Sep 14, 2016
Python How to share info between events Mar 16, 2016
Share Your Tricks for Satisfying Laziness in Your Programming Jan 8, 2016