Can't build yuvlib library function by visual stduio in cpp file

331 views Asked by At

I builded and used libyuv in visual studio 2017. I can build libyuv.h and function in c file. but If i change main.c file to main.cpp file then I cant build in cpp file. can anyone help me? i attached source/ refer to following link

https://github.com/stevenyeun/libyuvtest/tree/master/LibYuvTest/LibYuvTest

here is main.cpp

#include "libyuv.h"

#pragma comment(lib, "yuv.lib")

void main()
{
    NV12ToARGB(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}

error C3861: 'NV12ToARGB': identifier not found

I tried to add extern "C" keyword but cant build yet

1

There are 1 answers

1
user7860670 On

When compiled as C++ all functions are wrapped into libyuv namespace so invocation should look like ::libyuv::NV12ToARGB(nullptr,