Alexander Fedosov
Alexander Fedosov

Reputation: 1

GCC - Dynamic Dependencies

Good day! I've got a problem with linkage on Linux using gcc. For example, I've compiled project on one machine and linked it with libGLEW. When I'm trying to run it on another machine - it can't find libGLEW, because first machine has libGLEW.so.1.7 and second has libGLEW.so.1.10.

ldd shows me, that it dependent on 'libGLEW.so.1.7'. after creating symlink 'libGLEW.so.1.7 => libGLEW.so.1.10' everything works fine, but is there a way, to store 'libGLEW.so' as dependency instead of 'libGLEW.so.1.7'?

Upvotes: 0

Views: 75

Answers (1)

dhein
dhein

Reputation: 6555

What makes you sure the function interface of GLEW doesn't have changed? Or even the content of version 1.1 to 1.7 is still the same?

If it is build with 1.7, it also depends on 1.7. So you shouldn't run it on another version of GLEW, except the api documentation of GLEW tells you that this cross versioning is possible for some reason (But I couldn't imagine that).

Otherwise also build it with GLEW 1.1 in addition

(because as if all features you use from 1.7 are also supported by 1.1 and for some reason you have to support both versions), so to serve different versions fo your programm for different versions of GLEW would be the best and valid way.

If that is not the case make it for the user as requirement to be on Glew version 1.7 or higher.

But there is no safe way of working around to archive what you want. And there is not a gcc or any compiler command for that at all.

Upvotes: 1

Related Questions