我正在尝试使用以下命令在 Debian 64 位 GNU/Linux 6.0.4 (squeeze) 下编译 glib 2.24.2:
gcc 4.0.3
glibc 2.3.6
配置命令:
CPP="/home/swarkentin/externalBins/bin/cpp" \
CC="/home/swarkentin/externalBins/bin/gcc" \
CXX="/home/swarkentin/externalBins/bin/g++" \
LDFLAGS="-L/home/swarkentin/externalBins/lib64 -L/home/swarkentin/externalBins/lib" \
CFLAGS="-I /home/swarkentin/externalBins/include -O2 -fno-strict-aliasing -fno-omit-frame-pointer" \
./configure --prefix=/home/swarkentin/target \
--enable-static --disable-shared
我收到错误:
checking thread related cflags... -D_REENTRANT
checking for pthread_create/pthread_join... no
checking for pthread_create/pthread_join in -lpthread... no
checking for pthread_create/pthread_join in -lpthread32... no
checking for pthread_create/pthread_join in -lpthreads... no
checking for pthread_create/pthread_join in -lthread... no
checking for pthread_create/pthread_join in -ldce... no
configure: error: I can't find the libraries for the thread implementation
posix. Please choose another thread implementation or
provide information on your thread implementation.
You can also run 'configure --disable-threads'
to compile without thread support.
我如何指向/查找 posix 线程库以使其通过配置步骤?
比方说,我包括 --disable-threads。现在我可以完成配置,但 make 结束时出现错误:
gcancellable.c: In function 'IA__g_cancellable_reset':
gcancellable.c:372: error: 'g__cancellable_lock' undeclared (first use in this function)
gcancellable.c:372: error: (Each undeclared identifier is reported only once
gcancellable.c:372: error: for each function it appears in.)
gcancellable.c: In function 'IA__g_cancellable_disconnect':
gcancellable.c:764: error: 'g__cancellable_lock' undeclared (first use in this function)
make[5]: *** [gcancellable.lo] Error 1
答案1
您可能丢失了libc6-dev
包裹。
你跑apt-get install build-essential
了吗?