Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why I'm getting this error message? /usr/local/include/opencv2/core/utility.hpp:362:47: error: reinterpret_cast from 'nullptr_t' to 'int *' is not allowed

 Dears

I'm trying a port of opencv 3.1 in FreeBSD 11 with clang 3.8. When I compile a minimalist program like this:

#include <opencv2/opencv.hpp>

int main(){
    cv::Mat myMat;

    return 0;
}

with c++11 or above enabled, I get this error message:
[ota@nostromo /usr/home/ota/Desktop]$ c++ -I/usr/local/include -L/usr/local/lib -o main main.cpp -lopencv_core -std=c++11
In file included from main.cpp:1:
In file included from /usr/local/include/opencv2/opencv.hpp:46:
In file included from /usr/local/include/opencv2/core.hpp:3165:
/usr/local/include/opencv2/core/utility.hpp:362:47: error: reinterpret_cast from
      'nullptr_t' to 'int *' is not allowed
        operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(NULL));
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


When open the file this warning is there:

template<typename _Tp, typename Functor> inline
void Mat::forEach_impl(const Functor& operation) {
    if (false) {
        operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(NULL));
        // If your compiler fail in this line.
        // Please check that your functor signature is
        //     (_Tp&, const int*)   <- multidimential
        //  or (_Tp&, void*)        <- in case of you don't need current idx.
        }

Why I'm getting this error? My program is only a toy program. How to fix it?

Why I'm getting this error message? /usr/local/include/opencv2/core/utility.hpp:362:47: error: reinterpret_cast from 'nullptr_t' to 'int *' is not allowed

 Dears

Dears

I'm trying a port of opencv 3.1 in FreeBSD 11 with clang 3.8. When I compile a minimalist program like this: this:

#include <opencv2/opencv.hpp>

int main(){
    cv::Mat myMat;

    return 0;
}
 

with c++11 or above enabled, I get this error message: message:

[ota@nostromo /usr/home/ota/Desktop]$ c++ -I/usr/local/include -L/usr/local/lib -o main main.cpp -lopencv_core -std=c++11
In file included from main.cpp:1:
In file included from /usr/local/include/opencv2/opencv.hpp:46:
In file included from /usr/local/include/opencv2/core.hpp:3165:
/usr/local/include/opencv2/core/utility.hpp:362:47: error: reinterpret_cast from
      'nullptr_t' to 'int *' is not allowed
        operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(NULL));
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
 

When open the file this warning is there: there:

template<typename _Tp, typename Functor> inline
void Mat::forEach_impl(const Functor& operation) {
    if (false) {
        operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(NULL));
        // If your compiler fail in this line.
        // Please check that your functor signature is
        //     (_Tp&, const int*)   <- multidimential
        //  or (_Tp&, void*)        <- in case of you don't need current idx.
        }
 

Why I'm getting this error? My program is only a toy program. How to fix it?

it?