[riot-users] Use POSIX pthreads in pkg

Philipp Blum philipp-blum at jakiku.de
Sun Oct 21 20:21:17 CEST 2018



I have a library which includes <pthreads.h>. 
I use a github repo and create a static library with Cmake. It copies it
then to binddir of riot. 

I basically copied another libraries Makefile, to understand how it
supposed to work. 

all: $(PKG_BUILDDIR)/src/Makefile
    $(MAKE) -C $(PKG_BUILDDIR) && \
    cp $(PKG_BUILDDIR)/libiota_wallet.a $(BINDIR)/iota-wallet.a

    cd $(PKG_BUILDDIR) && \

$(TOOLCHAIN_FILE): git-download
    $(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh >

I got another file named Makefile.dep, where I placed my dependencies: 

USEMODULE += posix
USEMODULE += pthread 

and a Makefile.include 

INCLUDES += -I$(PKGDIRBASE)/iota-wallet/src 

When I start make in my application folder I get the following error

In function 'create_bundle_bytes':
error: implicit declaration of function 'pthread_mutex_lock'; did you
mean 'pthread_atfork'? [-Werror=implicit-function-declaration]

The bundle.c and the bundle.h have: 

#include <pthread.h> 

So, that shouldn't be an issue. So what did I miss. How do I make it
possible that the compiler finds the pthread implementation? 

Thanks for you help :) 

best regards 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20181021/bc0db000/attachment.html>

More information about the users mailing list