[SOLVED] Developing a new package that depends on another OpenWrt package

I am a beginner in developing software for OpenWRT. I have done "Hello, world!" successfully.

I have wrote a simple MQTT client using libmosquitto library and it works well on my Linux PC.

Then I tried to make the code as a package for OpenWRT (like "Hello, world!" example).

I have encountered a lot of problems.

Mainly because the tool chain does not see libmosquitto.

How can I add a package (like libmosquitto-ssl) to the build environment in order to be seen by tool chain?

Any idea, What I have to do in a situation like this ?

I'm not at my main build machine right now, but I'm fairly certain OpenWRT has mosquitto available as a package option.

You might simply need to add that package to the DEPENDS for your package.

Suggested reading:

The problem is SOLVED.

Through this thread: [probably solved] How to build on debian 9? Missing libpam, libgnutls,

And by adding this option:
at the end of the second line of Package build instructions (Build/Compile) section in Makefile, like that:

$(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/mynewpackage.o -lmosquitto


You probably still need to update DEPENDS to ensure that mosquitto is always selected AND is built before your package.

Otherwise whether your package succesfully builds or not will not be deterministic.

I have missed to mention adding DEPENDS in Makefile.

I have added

DEPENDS:= +libmosquitto-ssl

In Package definition section in Makefile

Excuse me Andy Dodd (Entropy512),

yup, that should take care of it. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.