2

I am programming an application to be monitored with (net)snmp.

So when I run snmpget it will trigger a request for my program in C to get the data. The only problem is my program uses libcurl.

The function getSettings below uses libcurl:

HttpData* s = getSettings("max_ul_rate");
snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *) &s->ptr, s->len+1);

When a I run netsnmp make it gives me an error that it doesn't find CURL. How can I add LIBCURL to NET-SNMP's Makefile?

McGarnagle
  • 101,349
  • 31
  • 229
  • 260

1 Answers1

0

I found a person with a similar problem on StackOverFlow. Creating a makefile for a standalone piece of code using libcurl, should be the same process, so you could also google that.

Linking cURL in Makefile

Community
  • 1
  • 1
Dane Balia
  • 5,271
  • 5
  • 32
  • 57
  • The link suggest compiling with C++ and I wanna do it with C.I tried putting curlinstall: $(CURL_SOURCES) $(CURL_H) \ $(CC) -o $(CURL_OUT) -I/usr/local/include -Wall -Werror -L/usr/local/lib -lcurl $(CURL_SOURCES) It didnt work – Fernanda Martins Nov 18 '12 at 20:17
  • Try this - it explains how to get the flags you need for gcc (http://curl.haxx.se/libcurl/c/libcurl-tutorial.html). Also here are examples, which contain sample compilation flags (in the source) and parameters which you can make part of your Makefile. – Dane Balia Nov 19 '12 at 05:46