c++ - 错误/usr/include/string.h :652:42: error: ‘memcpy’ was not declared in this scope while building caffe

标签 c++ compilation compiler-errors makefile cuda

我正尝试按照本指南编译 caffe:https://gist.github.com/wangruohui/679b05fcd1466bb0937f

但是,当我太make all时,我得到了错误

NVCC src/caffe/layers/hdf5_data_layer.cu
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
Makefile:585: recipe for target '.build_release/cuda/src/caffe/layers/hdf5_data_layer.o' failed

但是/usr/include/string.h 甚至不在 caffe 代码中,所以给出了什么?这是紧随 16.04 的 ubuntu 变体

鉴于代码的来源是一个众所周知的 repo,我认为问题可能出在 Makefile 或 Makefile.config 中

最佳答案

经过很长时间浏览各种互联网资源后,我通过转到 Makefile 并更改行解决了这个问题

NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)

进入

NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)

对我来说,这是在线 406

关于c++ - 错误/usr/include/string.h :652:42: error: ‘memcpy’ was not declared in this scope while building caffe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37241510/

相关文章:

linux - 什么可以阻止在不同平台上编译的 Linux 发行版上运行二进制文件?

c# - 添加动态评级控件时出现奇怪的编译问题

java - stmt.executeUpdate 上的 java servlet 中出现错误

c++ - 为什么编译后没有.o?

java编译的类包含美元符号

compiler-errors - 编译非常简单的Lex/Yacc文件时出现“something not a structure or union”错误

C++ 将 Int 拆分为 4 个部分(32 位机)

c++ - 将一个dll文件导入另一个IDL文件

c++ - 具有全局定义变量的递归比没有全局定义变量的递归函数获得更多堆栈。为什么? (跳入 C++)

c++ - 从 C 中的函数返回 {0}?