我想編譯一個庫,liblo。我正在安裝它,因爲它是我正在嘗試安裝的另一個庫的必需庫,osc-mex。爲了在Windows上使用liblo與osc-mex一起工作,我需要使用「pthreads commented out」編譯liblo。「註釋掉pthreads」來編譯庫
據我所知,pthread是一個用於Unix的協議嗎?無論如何,我需要刪除pthread中的liblo代碼。但是我遇到了一個問題;有'pthread'提到的代碼的多個區域。搜索的(未編譯)來源liblo目錄文本「並行線程」產量25個結果在八檔:
Filename Line # Line text
*********************************************************************************
ChangeLog 165 * Fixed pthread resource leak, when stopping thread
NEWS 153 * Fixed pthread resource leak, when stopping server
config.h.in 18 /* Define to 1 if you have the `pthread' library (-lpthread). */
config.h.in 19 #undef HAVE_LIBPTHREAD
configure 11000 { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
configure 11001 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
configure 11002 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
configure 11006 LIBS="-lpthread $LIBS"
configure 11020 char pthread_create();
configure 11024 return pthread_create();
configure 11047 ac_cv_lib_pthread_pthread_create=yes
configure 11052 ac_cv_lib_pthread_pthread_create=no
configure 11059 { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
configure 11060 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
configure 11061 if test $ac_cv_lib_pthread_pthread_create = yes; then
configure 11063 #define HAVE_LIBPTHREAD 1
configure 11066 LIBS="-lpthread $LIBS"
configure.ac43 AC_CHECK_LIB([pthread], [pthread_create])
liblo.pc.in 9 Libs: -L${libdir} -llo -lpthread
libtool 4511 # Do not include libc_r directly, use -pthread flag.
libtool 4536 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
libtool 5030 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
ltmain.sh 4027 # Do not include libc_r directly, use -pthread flag.
ltmain.sh 4052 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
ltmain.sh 4546 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
顯然,上述的一些線路已經評價,但也有線路在這裏這可以通過許多不同的方式進行修改以實現相同的目標。 「註釋pthreads」的指令是我不完全理解或知道如何實現的。任何意見,將不勝感激。
我假設你在Windows上也使用configure腳本;如果是這樣,'./configure --help'是否提供禁用pthread的選項? – 2013-02-14 11:32:50
請問您可以添加一個腳註,說這個問題與[this one](http://stackoverflow.com/questions/14853603/unable-to-compile-mex)和[this one](http:// stackoverflow .COM /問題/ 14789656 /鏈接與Matlab至A-DLL庫)? – Shai 2013-02-14 11:52:37
有一個與Windows兼容的pthreads版本。如果你已經安裝了,那麼你不需要重新配置liblo來不使用它。 – Neil 2013-02-14 13:14:02