How to make a package with #include <curl/curl.h>?

Hello all,

I am sure this is a noob mistake!

I am trying to make a package with a program that has the directive #include <curl/curl.h>.
This is a simple program and it works in my PC.

I added the libcurl in
make menuconfig

and then I did a
make distclean
make toolchain/install

However, when I try to make my package with

make -j1 V=sc package/mqtt_exemplo2/compile

I get this error:

mqtt_exemplo2.c:9:10: fatal error: curl/curl.h: No such file or directory
 #include <curl/curl.h>

Can anyone help?
Many thanks in advance!

libcurl or the like needs to be a dependency of the package.

@Jeff: Many thanks for your reply.

I did your suggestion and the error of the include is gone! :slight_smile:

However, the compile still halts in error.

The curl functions I am using are not recognized! Shouldn't they be in the lib?

(the code mqtt_exemplo2.c is running perfectly in my pc!)

This is the output of:

make -j1 V=sc package/mqtt_exemplo2/compile
mqtt_exemplo2.o: In function `main':
mqtt_exemplo2.c:(.text.startup+0x2f): undefined reference to `curl_global_init'
mqtt_exemplo2.c:(.text.startup+0x35): undefined reference to `curl_easy_init'
mqtt_exemplo2.c:(.text.startup+0x52): undefined reference to `curl_easy_setopt'
mqtt_exemplo2.c:(.text.startup+0x5b): undefined reference to `curl_easy_perform'
mqtt_exemplo2.c:(.text.startup+0x67): undefined reference to `curl_easy_strerror'
mqtt_exemplo2.c:(.text.startup+0x87): undefined reference to `curl_easy_cleanup'
mqtt_exemplo2.c:(.text.startup+0x8d): undefined reference to `curl_global_cleanup'
collect2: error: ld returned 1 exit status
make[3]: *** [makefile:10: mqtt_exemplo2] Error 1

I opened a new topic to follow this problem here:

Hi @azul ,
I'm also a beginner at this and starting to build a package of my own.
I have similar issue with this using the cross compiler.
I followed this tutorial and it taught me how to compile a single file with no dependency.
I don't know how to make a package and put the code in yet. The last part of the tutorial refers to building a project from a git repository.
I don't really want to do that, I only need to put in small pieces of code. Can I see how you're doing your custom package?