Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22240

Can static linking eliminate dependancy issues

$
0
0

I need to compile a small code that will connect to (Open)LDAP Server and extract some info. Is there a chance for me to compile that code so that there are no needs for dependencies when i move that program to a lot of servers?

If i compile it as usual

g++ -o auth -lldap auth.c

It will depend on openldap package and i would like to avoid installing that if all possible. Would static linking libraries be a way to achieve that and if does, how so, because if i add -static parameter on g++, it will say

/usr/bin/ld: cannot find -lldap
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status

Is there any other method of achieving this?


Viewing all articles
Browse latest Browse all 22240

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>