-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
下载后编译直接报错 #336
Comments
同时还有一些警告 |
顶层 cmakelists.txt 添加 add_definitions(-std=c++11) 试试看... |
@nihui 你好这个CMakeLists.txt是在ncnn根目录下还是在tools下的?十分感谢 |
@zhixuanli 你好,这个Makefile是指哪个啊?是Makefile2吗?还是在哪里?谢谢 |
@double-vane |
@zhixuanli 十分感谢收到回复,谢谢 |
@zhixuanli 你好,又麻烦你了,我在CMakeList里加入add_definitions(-std=c++11)是可以编译成功的,但是在使用的时候会报错: |
@double-vane Actually I was searching for another problem when I saw this issue. I have no experience about ncnn, but I know a little about Good Luck! |
@zhixuanli 感谢收到你的回复,我也是这样加的,但是还是出这个错: |
@double-vane Sorry, I don't know how to solve this problem😂 |
@zhixuanli 还是特别感谢你,我再找找解决方法,如果能解决,再告你一声 |
@double-vane 😉😉 |
您好,特别感谢收到您的解决方案,十分感谢
…------------------ 原始邮件 ------------------
发件人: "Tencent/ncnn" ***@***.***>;
发送时间: 2021年6月7日(星期一) 下午2:44
***@***.***>;
***@***.******@***.***>;
主题: Re: [Tencent/ncnn] 下载后编译直接报错 (#336)
@zhixuanli 你好,又麻烦你了,我在CMakeList里加入add_definitions(-std=c++11)是可以编译成功的,但是在使用的时候会报错:
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Abort
我从网上查,说是在编译的时候加入-pthread
类似于 -std=c++11 -pthread 1.cpp
由于我不熟悉c++,所以我不清楚在哪里加。
然后试了试你说的方法,编译不成功,所以能帮帮我在哪里加-pthread
您好,我也遇到了CMakeFiles/Makefile2:203: recipe for target 'tools/caffe/CMakeFiles/caffe2ncnn.dir/all' failed 这个报错。然后尝试替换protobuf的版本,还是不行,最后强行删除protobuf,然后用pip install protobuf的方式重新安装。然后再编译ncnn,居然成功了。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
不客气:) |
我直接操作如下
make 时报错
In file included from /usr/include/c++/5/atomic:38:0,
from /usr/local/include/google/protobuf/io/coded_stream.h:113,
from /home/liupeng/ncnn/tools/caffe/caffe2ncnn.cpp:24:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
^
In file included from /usr/local/include/google/protobuf/stubs/common.h:52:0,
from /usr/local/include/google/protobuf/io/coded_stream.h:135,
from /home/liupeng/ncnn/tools/caffe/caffe2ncnn.cpp:24:
/usr/local/include/google/protobuf/stubs/mutex.h:58:8: error: ‘mutex’ in namespace ‘std’ does not name a type
std::mutex mu_;
^
/usr/local/include/google/protobuf/stubs/mutex.h: In member function ‘void google::protobuf::internal::WrappedMutex::Lock()’:
/usr/local/include/google/protobuf/stubs/mutex.h:51:17: error: ‘mu_’ was not declared in this scope
void Lock() { mu_.lock(); }
^
/usr/local/include/google/protobuf/stubs/mutex.h: In member function ‘void google::protobuf::internal::WrappedMutex::Unlock()’:
/usr/local/include/google/protobuf/stubs/mutex.h:52:19: error: ‘mu_’ was not declared in this scope
void Unlock() { mu_.unlock(); }
^
/usr/local/include/google/protobuf/stubs/mutex.h: At global scope:
/usr/local/include/google/protobuf/stubs/mutex.h:61:7: error: expected nested-name-specifier before ‘Mutex’
using Mutex = WrappedMutex;
^
/usr/local/include/google/protobuf/stubs/mutex.h:66:28: error: expected ‘)’ before ‘*’ token
explicit MutexLock(Mutex *mu) : mu_(mu) { this->mu_->Lock(); }
^
/usr/local/include/google/protobuf/stubs/mutex.h:69:3: error: ‘Mutex’ does not name a type
Mutex const mu_;
^
/usr/local/include/google/protobuf/stubs/mutex.h: In destructor ‘google::protobuf::internal::MutexLock::~MutexLock()’:
/usr/local/include/google/protobuf/stubs/mutex.h:67:24: error: ‘class google::protobuf::internal::MutexLock’ has no member named ‘mu_’
~MutexLock() { this->mu_->Unlock(); }
^
/usr/local/include/google/protobuf/stubs/mutex.h: At global scope:
/usr/local/include/google/protobuf/stubs/mutex.h:80:33: error: expected ‘)’ before ‘’ token
explicit MutexLockMaybe(Mutex *mu) :
^
In file included from /usr/local/include/google/protobuf/arena.h:48:0,
from /usr/local/include/google/protobuf/message.h:118,
from /usr/local/include/google/protobuf/text_format.h:48,
from /home/liupeng/ncnn/tools/caffe/caffe2ncnn.cpp:26:
/usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected unqualified-id before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected declaration before end of line
tools/caffe/CMakeFiles/caffe2ncnn.dir/build.make:70: recipe for target 'tools/caffe/CMakeFiles/caffe2ncnn.dir/caffe2ncnn.cpp.o' failed
make[2]: *** [tools/caffe/CMakeFiles/caffe2ncnn.dir/caffe2ncnn.cpp.o] Error 1
CMakeFiles/Makefile2:203: recipe for target 'tools/caffe/CMakeFiles/caffe2ncnn.dir/all' failed
make[1]: *** [tools/caffe/CMakeFiles/caffe2ncnn.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered: