FreeBSD: error: call to undeclared function 'nvenc_device_available'
Operating System Info
Other
Other OS
FreeBSD 14.1
OBS Studio Version
30.2.0
OBS Studio Version (Other)
No response
OBS Studio Log URL
n/a
OBS Studio Crash Log URL
No response
Expected Behavior
n/a
Current Behavior
Due to inconsistent ifdefs the build fails:
/usr/ports/multimedia/obs-studio/work/obs-studio-30.2.0/plugins/obs-ffmpeg/obs-ffmpeg.c:275:13: error: call to undeclared function 'nvenc_device_available'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
275 | success = nvenc_device_available() && load_nvenc_lib();
| ^
1 error generated.
Steps to Reproduce
Regular build.
Anything else we should know?
No response
Are you building with legacy Cmake? That line being included would require the nvcodec library to be found, but some of that is explicitly gated for Linux, and should be in new cmake, but probably not the old one. Setting ENABLE_NATIVE_NVENC to OFF should work for the time being.
I use the regular ffmpeg-6.1.1 package.
@derrod Any chance to fix this and make it buildable on FreeBSD?
I use the regular ffmpeg-6.1.1 package.
This wasn't what @derrod asked.
Are you building with our legacy CMake? That is, are you building without using the ubuntu preset or building without setting OBS_CMAKE_VERSION to 3.0.0? If you are building with legacy CMake, does it work when using the new CMake (use -DOBS_CMAKE_VERSION:STRING=3.0.0 when invoking CMake, or define a preset that sets the variable)?
As mentioned, setting ENABLE_NATIVE_NVENC to OFF in your configuration should make this work. Please let us know if it does not.