curl-library
GCRY_THREAD_OPTION_PTHREAD_IMPL;
Date: Wed, 24 Jun 2009 11:24:12 +0300
Hello
I am trying to compile:
#include <gnutls.h>
#include <gcrypt.h>
#include <errno.h>
#include <pthread.h>
GCRY_THREAD_OPTION_PTHREAD_IMPL;
int main()
{
/* The order matters.
*/
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
gnutls_global_init();
}
I have all the requirements to do this, curl built with gnutls, and all the
headers/libraries in place.
In fact I am using an exactly duplicated debian 5 64 bit environment where
this code will compile with gcc.
However gcc on Cent OS 5 64bit yields this:
[root_at_localhost code]# gcc -lpthread test.cpp -O -lgnutls -lssl -lcurl
-pthread
test.cpp: In function int gcry_pthread_mutex_init(void**):
test.cpp:5: error: malloc was not declared in this scope
test.cpp:5: error: free was not declared in this scope
test.cpp: In function int gcry_pthread_mutex_destroy(void**):
test.cpp:5: error: invalid conversion from void* to pthread_mutex_t*
test.cpp:5: error: initializing argument 1 of int
pthread_mutex_destroy(pthread_mutex_t*)
test.cpp:5: error: free was not declared in this scope
test.cpp: In function int gcry_pthread_mutex_lock(void**):
test.cpp:5: error: invalid conversion from void* to pthread_mutex_t*
test.cpp:5: error: initializing argument 1 of int
pthread_mutex_lock(pthread_mutex_t*)
test.cpp: In function int gcry_pthread_mutex_unlock(void**):
test.cpp:5: error: invalid conversion from void* to pthread_mutex_t*
test.cpp:5: error: initializing argument 1 of int
pthread_mutex_unlock(pthread_mutex_t*)
[root_at_localhost code]#
I would love to know why GCRY_THREAD_OPTION_PTHREAD_IMPL;
works just fine on debian but not centos.
Thank you very much,
John
Received on 2009-06-24