J'utilise ./configure pour configurer l'un des projets. J'obtiens l'erreur suivante.Autoconf - Pas de prise en charge POSIX. Configurez éventuellement en utilisant un code incorrect pour vérifier le support. Comment le réparer?
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
configure: error: POSIX threads support is required
Quand je vérifie le fichier de configuration, je vois qu'il utilise le code suivant pour vérifier le soutien pthread:
#include <pthread.h>
int main()
{
pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
;
return 0;
}
Quand je le compiler séparement, il ne compile. Mais avec les avertissements de pthread_create.
test_pthread.c:5:22: warning: null argument where non-null required (argument 1) [-Wnonnull]
pthread_attr_init(0); pthread_cleanup_push(0, 0);
^
test_pthread.c:6:22: warning: null argument where non-null required (argument 1) [-Wnonnull]
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
^
test_pthread.c:6:22: warning: null argument where non-null required (argument 3) [-Wnonnull]
Est-ce un bug dans la fenêtre de configuration de manière est la vérification de support -pthread avec le compilateur? Comment puis-je réparer cela? J'utilise autoreconf -i avant d'exécuter ./configure. Qu'est-ce qu'un moyen propre de résoudre ce problème?
------------ EDIT: Ajout Plus d'informations ----------
J'utilise les lignes suivantes dans le fichier configure.ac pour vérifier pthread. Je viens de le recevoir d'une config en ligne. il est évident
# Check for POSIX thread support
ACX_PTHREAD([
LIBS="$LIBS $PTHREAD_LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS -g -Wall"
CC="$PTHREAD_CC"
AC_SUBST([LIBS])
AC_SUBST([CFLAGS])
AC_SUBST([CC])
],
[AC_MSG_ERROR([POSIX threads support is required])])
Les avertissements ne doivent pas empêcher le test de réussir. Vous devrez inclure dans la question plus du fichier source autoconf qui implémente ces tests. – caf
@caf: Ajout des lignes de code que j'utilise dans le fichier configure.ac. – theCuriousOne
Vous n'avez pas défini '-Werror' dans votre CFLAGS avant ce moment? – caf