[英]How do I tell acgmake to use -pthread?
我在使用VMware虛擬機(Linux來賓)的Windows上構建此應用程序,該應用程序可在其他Linux機器上編譯。 它具有一個makefile並完成。 然后,我運行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-strings -Wno-ignored-qualifiers -pthread CXX_LDFLAGS += -Xlinker --no-warn-search-mismatch -pthread endif
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.