Install OpenCV-3.1.0 fails on Ubuntu 16.04 (‘memcpy’ was not declared in this scope)

Compiling on a clean install of Ubuntu 16.04 with cmake and using CUDA from the repo.

get the following error:

/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; ^/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; ^/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; ^/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; ^/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; ^/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; ^/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; ^CMake Error at cuda_compile_generated_sgd_solver.cu.o.cmake:266 (message): Error generating file /opt/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_sgd_solver.cu.o
Seems TensorFlow has similar issues: fayeshine/tensorflow@6c8c572


Answer:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")
add the line in the front of the CMakeLists.txt
the gcc is too new;


The installation scripts:

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j 4
sudo make install
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值