This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

_nassert() undefined reference inside of #pragma omp target region

Hi all,

I am trying to use _nassert() inside of the #pragma omp target region, to make sure the data is properly aligned. But the compiler yields the errors 

undefined reference to `_nassert'

It seems that I missed a header file, or linker option. Could you please point me out?

Cheng

  • Cheng,

    The error message, "undefined reference to `_nassert'" is from the host compiler - gcc cannot find a definition of _nassert. I'd suggest adding the following to a source file that is compiled only for the host:

    extern "C" {
        void _nassert(int x) {}
    }

    Ajay