我如何告诉 acgmake 使用 -pthread
How do I tell acgmake to use -pthread?
我正在构建这个应用程序,该应用程序可以在其他Linux机器上编译,在Windows上与VMware虚拟机(linux guest)一起编译。它有一个生成文件并完成。然后我运行acgmake,这应该制作运行所需的所有文件。我收到此错误:
Build executable Debian64_gcc4.6_dbg/libsrc_CadModel.so -> Debian64_gcc4.6_dbg/cadmodel
/home///intel/mkl/10.2.2.025/lib/em64t/libiomp5.so: undefined reference to `pthread_atfork'
我发现我需要为 gcc(或其他东西)指定-pthread
标志。这是怎么做到的?该ACGMakefile
包含:(编辑:CadModel/ACGmakefile)
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
CXX_CFLAGS += -DQT_THREAD_SUPPORT
ifeq ($(findstring g++,$(CXX_COMP)),g++)
CXX_CFLAGS += -Wno-write-strings -Wno-ignored-qualifiers
CXX_LDFLAGS += -Xlinker --no-warn-search-mismatch
endif
SUBDIRS = $(call find-subdirs)
PACKAGES := ftgl opencascade qt4 glut opengl x11 math mkl
PROJ_LIBS = OpenMesh/Core
MODULES := moc4 rcc cxxlib cxx
all: build
info:
@echo "Using compiler $(filter g++, $(CXX_COMP))"
# @echo "CFLAGS = $(CXX_LDFLAGS)"
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
run: $(cxx-exes)
./$(cxx-exes)
链接
器需要-lpthread
或-pthread
。
您可能还想告诉链接器在哪里可以找到库,如果它们未在LD_LIBRARY_PATH
中设置,请使用 -L/path/to/lib
选项。
尝试将-pthread
添加到
ifeq ($(findstring g++,$(CXX_COMP)),g++)CXX_CFLAGS += -Wno-write-string -Wno-ignore qualifiers -pthreadCXX_LDFLAGS += -Xlinker --no-warn-search-mismatch -pthread恩迪夫
相关文章:
- 使用 -pthread 如何不违反 ODR 规则?
- 使用 pthread 的多线程
- 如何修复下一个线程以使其更正确?使用 Pthread
- 使用全局变量显示C++在使用 pthread 时比指针慢 100%?
- 在使用 pthread 和信号量实现生产者-消费者问题时需要帮助
- 当其中一个线程在 C++ 中使用 pthread 被杀死时,我如何保持进程的存活
- 使用 pthread 打印二维数组
- Opencv分段错误使用pthread捕获帧C++
- 如何修复:在c++中使用pthread执行lambda表达式
- 如何使用"-pthread"而不是"-mthread"编译boost_thread?
- 什么时候使用pthread屏障而不是条件等待和广播更合适
- 如何在Qt Creator上使用pthread
- 如何使用 pthread 获取信号量的信息
- 如何让 cmake 使用 "-pthread" 而不是 -lpthread"?
- 使用 pthread 并发推送()到共享队列
- 我如何告诉 acgmake 使用 -pthread
- 为什么使用 pthread 的 Ubuntu 中的单线程比多线程快
- 我们可以使用 pthread 库进行 opencv C++编程吗?
- 使用pthread创建mandelbrot图像
- 在c++中使用pthread查找数组的最大值