编译库"Comment out pthreads"
"Comment out pthreads" to compile a library
我正在尝试编译一个库,liblo。我之所以安装它,是因为它是我试图安装的另一个库osc-mex所必需的库。为了让liblo在Windows上与osc-mex一起工作,我需要使用"pthreads comment-out"编译libro。
据我所知,pthread是Unix使用的协议吗?无论如何,我需要删除liblo代码中提到的pthread。但我遇到了一个问题;代码中有多个区域提到了"pthread"。在liblo目录的(未编译的)源中搜索文本"pthreads"会在八个文件中产生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"的指令是我不完全理解或不知道如何实现的。如有任何建议,我们将不胜感激。
osc-mex的链接指令引用了几年前的liblo版本。目前,git版本的liblo应该在Windows上编译(使用MingW),而不做任何更改。pthread现在是可选的。它检测pthread是否可用,如果不可用,则为您"注释"。
config.h.in
文件中的第18行和第19行似乎有一个常数HAVE_LIBPTHREAD
,表示pthread库的存在/不存在。
您是否尝试使用未定义的HAVE_LIBPTHREAD
编译代码?
相关文章:
- IN, OUT, INOUT Parameters
- 即使使用调试编译标志,表达式也是"optimized out"
- C++双重释放或损坏(out)
- C++ PTHREADS - 无效转换无效*(*)()到无效*(*)(无效*)
- 将 out/in out 参数与 if/switch 的 init 语句一起使用
- 在命令行上将输入显示到数组中时如何删除 ./a.out?
- 为什么我的向量::擦除调用会抛出"vector subscript out of range"?
- 为什么我不能让 3 个网络摄像头与 pthreads 并行运行?
- 解决方案在第 25 行执行错误'out of bounds'
- C++ 向量加减抛出"expression: vector subscript out of range."错误
- 对函数的 out 字符串参数使用 swap 与赋值
- 运行编译的 a.out 后出现分段错误(核心转储)错误
- 如何使用 Pthreads 并行化图像翻转?
- 在 Metal 着色器代码中,如何定义函数的 in/out 参数变量?
- 赋值运算符上的双重释放或损坏(out)
- "in"和"out"在参数方向上是什么意思?
- 从 MSVC14 切换到 MSVC16 会导致"compiler is out of heap space (C1060)"错误
- -bash:/a.out:无法执行二进制文件:Exec格式错误
- 庞大的初始化列表,如何修复"fatal error C1060: compiler is out of heap space"
- 编译库"Comment out pthreads"