Why are my G++ shared libraries incompatible after switching to Opensuse 12.3?

  • Thread starter Thread starter PPeter
  • Start date Start date
  • Tags Tags
    Issues
AI Thread Summary
The discussion revolves around issues encountered when transitioning from Arch Linux to OpenSUSE 12.3 while compiling a C++ program using g++. The user reports errors indicating that certain libraries, specifically libtcod and libtcodxx, are incompatible or not found during the linking process. Suggestions for troubleshooting include checking the LD_LIBRARY_PATH environment variable to ensure it points to the correct directories containing the shared libraries. Additionally, it is noted that compatibility issues may arise from differences in architecture, such as mixing 32-bit and 64-bit libraries, or from potential discrepancies between static and dynamic libraries. The importance of ensuring that the libraries match the compilation mode is emphasized, as well as the need to understand the nature of shared libraries in this context.
PPeter
Messages
3
Reaction score
1
Before I switched to Opensuse 12.3, I was running Arch, and doing something like:
Code:
g++ -o test -I ./include/ -L ./lib/ -ltcod -ltcodxx ./src/main.cpp
with no problems occurring.

Now, when I try to do that (with everything kept the exact same as when on Arch), I get:
Code:
/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.
 
Technology news on Phys.org
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.
 
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.
 
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top