Skip to content
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

Compile error #6

Open
zouhongwei opened this issue Oct 17, 2017 · 6 comments
Open

Compile error #6

zouhongwei opened this issue Oct 17, 2017 · 6 comments

Comments

@zouhongwei
Copy link

When I complie caffe, I get some error, the output information is list bellow! Can you help me?

#######################################################################
In file included from /usr/include/c++/4.8/algorithm:62:0,
from /home/zouhongwei/workspce/caffe-yolo-9000/include/caffe/blob.hpp:4,
from /home/zouhongwei/workspce/caffe-yolo-9000/include/caffe/caffe.hpp:7,
from /home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/netforward.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _Ra ndomAccessIterator, const _Tp&) [with _RandomAccessIterator = yolo_v2::DATA*; _Tp = yolo_v2::DATA]’:
/usr/include/c++/4.8/bits/stl_algo.h:2283:70: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIte rator, _RandomAccessIterator) [with _RandomAccessIterator = yolo_v2::DATA*]’
/usr/include/c++/4.8/bits/stl_algo.h:2315:54: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator , _Size) [with _RandomAccessIterator = yolo_v2::DATA*; _Size = long int]’
/usr/include/c++/4.8/bits/stl_algo.h:5461:36: required from ‘void std::sort(_RAIter, RAIter) [with RAIter = yolo_v2::DATA*]’
/home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:97:51: required from ‘std::vector<yolo_v2::DATA> yolo_v2::getResult(std::vector&, std::vector&, int, float, float) [with int OBJECT_NUM
= 5; int SIDE
= 13]’
/home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/netforward.cpp:86:86: required from here
/usr/include/c++/4.8/bits/stl_algo.h:2245:19: error: passing ‘const yolo_v2::DATA’ as ‘this’ argument of ‘bool yolo_v2::DATA::operator <(yolo_v2::DATA)’ discards qualifiers [-fpermissive]
while (__pivot < *__last)
^
make[2]: *** [examples/CMakeFiles/netforward.dir/yolo_9000_test/netforward.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/netforward.dir/all] Error 2
make: *** [all] Error 2

######################################################################

@karta0807913
Copy link
Owner

umm.. that is interesting
can you change
caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:21

bool operator<(DATA data)
to
bool operator<(const DATA &data)

and try again?

@zouhongwei
Copy link
Author

I tried it, but it does not work!

@karta0807913
Copy link
Owner

got the same error?

@zouhongwei
Copy link
Author

yes, the same error!

@karta0807913
Copy link
Owner

karta0807913 commented Oct 22, 2017

On my ubuntu is ok
use g++ g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0
i think you need to update your g++ to 5 or upper

myname:/usr/include/c++$ ls
4.9/  4.9.3/  5/  5.4.0/

@TheNerd-alexis
Copy link

I had same problem, but I solved by changing
caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:21

bool operator<(DATA data)
to
bool operator<(const DATA &data) const

I hope it will help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants