I have a static library that is compiled with gcc 3.4.2. I am building a shared library that relies on this static lib. I will be building this shared library (.so) with gcc 4.2.2. I was wondering what are the potential pitfalls of using the 3.4.2 static library in a gcc 4.2.2 shared library?
A:
It should be fine. At the end of the day they are only binaries. As long as the 3.4.2 static library is compiled for the same platform as what your shared library will be, you shouldn't have any problems.
Linz
2010-05-28 19:26:32
A:
If your static library is c++ based then I thought due to ABI changes it probably would not be compatible but according to this other stackoverflow question, gcc is forward compatible starting with gcc 3.4.0. So you could be ok. I had to rebuild all of my libraries going from gcc 3.0/3.2 to gcc 3.4.6 but I have not done the conversion to post-4.0 yet.
spdaley
2010-05-28 19:37:47