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?