我正在尝试构建一个使用OpenCV的NaCl项目。我使用getting_started代码的第2部分作为起点。我在某处读到OpenCV尚未移植到NaCl用于臂架构(或者我错了)。 这是我得到的输出:
CXX clang-newlib/Release/hello_tutorial_x86_32.o
LINK clang-newlib/Release/part2_unstripped_x86_32.nexe
VALIDATE clang-newlib/Release/part2_unstripped_x86_32.nexe
CXX clang-newlib/Release/hello_tutorial_x86_64.o
LINK clang-newlib/Release/part2_unstripped_x86_64.nexe
VALIDATE clang-newlib/Release/part2_unstripped_x86_64.nexe
CXX clang-newlib/Release/hello_tutorial_arm.o
hello_tutorial.cc:11:10: fatal error: 'opencv2/core/core.hpp' file not found
这是Makefile:
VALID_TOOLCHAINS := clang-newlib
NACL_SDK_ROOT := $(NACL_SDK_ROOT)
TARGET = part2
include $(NACL_SDK_ROOT)/tools/common.mk
LIBS = ppapi_cpp ppapi pthread opencv_core z
CFLAGS = -Wall -std=gnu++11
SOURCES = hello_tutorial.cc
# Build rules generated by macros from common.mk:
$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
# The PNaCl workflow uses both an unstripped and finalized/stripped binary.
# On NaCl, only produce a stripped binary for Release configs (not Debug).
ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
else
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif
$(eval $(call NMF_RULE,$(TARGET),))
我想知道如何避免构建我的arm架构应用程序。我还能做些什么来避免这个错误吗?
感谢。
答案 0 :(得分:0)
构建NaCl项目有几个变量。简而言之,必须正确设置NACL_ARCH,所以我在Makefile中添加以下行:
NACL_ARCH := x86_32 x86_64