buh
buh

Reputation: 363

undefined reference to 'gnutls_...' functions

So for an assignment I need to use GnuTLS. I have downloaded gnutls by following this guide http://www.bauer-power.net/2014/06/how-to-install-gnutls-3123-from-source.html

However, using any of the gnutls functions, similar to how they are used in the official gnutls documentation (http://www.gnutls.org/manual/html_node/Client-examples.html), displays several errors after building. All errors follow this format:

...pathtofile:line#/..undefined reference to 'gnutls_...'

I understand that this might be a linking problem, however I am quite new to this type of environment. What should I do? I have tried to install gnutls again several times.

I am using Ubuntu 14.04, gnutls-3.1.23 and eclipse Luna.

Thanks in advance.

Upvotes: 3

Views: 3718

Answers (1)

abligh
abligh

Reputation: 25129

You probably have an error on your link line.

Add the flag -lgnutls to the ld command (or, if just one C file, the compile line).

Upvotes: 2

Related Questions