Skip to content

Fix Bug when build without c++11 #212

Open
wangqiang1588 wants to merge 7 commits intohappynear:msfrom
wangqiang1588:ms
Open

Fix Bug when build without c++11 #212
wangqiang1588 wants to merge 7 commits intohappynear:msfrom
wangqiang1588:ms

Conversation

@wangqiang1588
Copy link

Fix Bug when build without c++11

remove warning

make compile success use cmake
@happynear
Copy link
Owner

Thanks for your effort.

However, is there any place that do not support C++11? I was thinking about adding C++11 parameter to CMake, then we can build caffe via both Cmake and Makefile in Linux.

@wangqiang1588
Copy link
Author

Some Linux Server like centos ,readhat linux ,gcc version is 4.8 ,which is not support c++11 。

even gcc 4.9 have bug on c++11 compile

please check modify ,we use #if __cplusplus < 201103L Micro make compatibility

@happynear
Copy link
Owner

Oh, I am not familiar with linux. In my mind, gcc 4.8 also support c++11...

@happynear
Copy link
Owner

GCC 4.81 has a full support for C++11.
https://gcc.gnu.org/projects/cxx-status.html

@happynear
Copy link
Owner

Using such macros makes codes harder to read. If we can build the code using most of the compilers, I think there is no need to get compatible with lower versions. Other libraries such as tensorflow and mxnet all need c++11 or even c++14.

Maybe a good solution is to add the c++11 option in CMakeList.txt.

@wangqiang1588
Copy link
Author

GCC 4.81 is the first version support C++ 11 ,it has a lot of bugs ,do not use C++11 before GCC 5.0,it may case application crash .

such as https://stackoverflow.com/questions/20594782/strange-behavior-with-c11-thread-in-gcc-4-8-1

it is a good idea to add C++11 option in CMakeList.txt.

but until now , it is better to support no C++11 version .

@wangqiang1588
Copy link
Author

I add this patch for project MTCNN_face_detection_alignment ,I have made CMakeList.txt for that project.

if you do not like this modify ,please just reject this . I will not supply patch again . Thanks

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

Successfully merging this pull request may close these issues.

2 participants