PDA

View Full Version : 'NDIlib_recv_create_t' is deprecated



ravenspoint
03-26-2019, 01:51 PM
When I compile code which includes calls to the NDI SDK I get numerous warnings of the type:


'NDIlib_recv_create_t' is deprecated

For example, this minimal program



#include <iostream>
#include <Processing.NDI.Lib.h>

int main()
{
if (!NDIlib_initialize())
throw std::runtime_error("Cannot initialize NDI");

NDIlib_find_instance_t pNDI_find = NDIlib_find_create_v2();
if (!pNDI_find)
throw std::runtime_error("Cannot initialize NDI");

return 0;
}


when compiled like this:


g++.exe -Wall -fexceptions -O2 -I"C:\Program Files\NewTek\NewTek NDI 3.8 SDK\Include" -c C:\Users\James\code\VisControl\ndi\test\main.cpp -o obj\Release\main.o

( g++ v8.3 running under MSYS2 )

produces a long string of


In file included from C:\Program Files\NewTek\NewTek NDI 3.8 SDK\Include/Processing.NDI.Lib.h:128,
from C:\Users\James\code\VisControl\ndi\test\main.cpp:2 :
C:\Program Files\NewTek\NewTek NDI 3.8 SDK\Include/Processing.NDI.deprecated.h:137:123: warning: 'NDIlib_recv_create_t' is deprecated [-Wdeprecated-declarations]
NDIlib_recv_instance_t NDIlib_recv_create_v2(const NDIlib_recv_create_t* p_create_settings NDILIB_CPP_DEFAULT_VALUE(NULL) );
^
C:\Program Files\NewTek\NewTek NDI 3.8 SDK\Include/Processing.NDI.deprecated.h:142:120: warning: 'NDIlib_recv_create_t' is deprecated [-Wdeprecated-declarations]
NDIlib_recv_instance_t NDIlib_recv_create2(const NDIlib_recv_create_t* p_create_settings NDILIB_CPP_DEFAULT_VALUE(NULL));
^
C:\Program Files\NewTek\NewTek NDI 3.8 SDK\Include/Processing.NDI.deprecated.h:148:88: warning: 'NDIlib_recv_create_t' is deprecated [-Wdeprecated-declarations]
NDIlib_recv_instance_t NDIlib_recv_create(const NDIlib_recv_create_t* p_create_settings);

....


The resulting program runs OK, but it is hard to spot genuine problems in the build log because they are drowned out by all these deprecated messages. How do I get rid of them?

ravenspoint
03-27-2019, 10:00 AM
Problem went away when I added compiler option:

-Wno-deprecated-declarations

brianbrice
03-28-2019, 11:29 AM
Just keep in mind that it may be worthwhile to update to the newer API.

ravenspoint
03-28-2019, 03:15 PM
I am not using the deprecated functions. Look at the code I posted, I am using NDIlib_find_create_v2(). Despite this, I still get the deprecated messages for the old functions that I am not using.

roddyp
04-02-2019, 09:04 AM
I am not using the deprecated functions.

It looks rather like a compiler bug when a deprecated function uses a deprecated class. It looks like you're using mingw, but what version?

PoV
07-04-2019, 11:09 AM
Related, but can we get a flag (something like NDILIB_NO_DEPRECATED) that outright doesn't expose the deprecated functions? `-Wno-deprecated-declarations` turns off warnings for deprecation, but still makes them available. I ended up manually editing the headers to shut-up the warnings, but next time I upgrade they'll be back. Thanks!