CUDA not found - Mingw32 with msvc toolchain

Questions that occur when trying to compile FFmpeg.
Post Reply
Posts: 1
Joined: Fri Feb 24, 2017 8:14 am

CUDA not found - Mingw32 with msvc toolchain

Post by chuckleplant » Fri Feb 24, 2017 9:46 am

I'm trying to build FFmpeg (tag n3.2.4)

I removed these two lines from the configure file

Code: Select all

die_license_disabled nonfree cuda
die_license_disabled nonfree cuvid
I opened ming32_shell.bat from a VS 2012 developer prompt

I ran the following:

Code: Select all

./configure                                      \
    --enable-shared                              \
    --disable-yasm                               \
    --disable-static                             \
    --disable-programs                           \
    --disable-swresample                         \
    --disable-postproc                           \
    --prefix=cohbuild                            \
    --enable-nvenc                               \
    --enable-cuda                                \
    --enable-cuvid                               \
    --toolchain=msvc                             \
    --extra-cflags=-I"C:\\cuda_8\\include"       \
I get the following error in config.log:

Code: Select all

./compat/windows/mslink -LIBPATH:C:\cuda_8\lib\Win32 -nologo -LARGEADDRESSAWARE -out:./ffconf.5Garc03V.exe ./ffconf.OhJRrnia.o cuda.lib psapi.lib advapi32.lib shell32.lib
ffconf.OhJRrnia.o : error LNK2019: unresolved external symbol _cuInit referenced in function _main
./ffconf.5Garc03V.exe : fatal error LNK1120: 1 unresolved externals
ERROR: CUDA not found
I do have cuda.lib in the specified LIBPATH, not sure how to proceed.

Can anyone give any hints?

Posts: 3
Joined: Wed Mar 29, 2017 9:45 am

Re: CUDA not found - Mingw32 with msvc toolchain

Post by hotkidfamily » Wed Mar 29, 2017 9:58 am


the configure file have some problems
you should fix it like this:

enabled cuda && { check_lib2 cuda.h cuInit -lcuda ||
die "ERROR: CUDA not found"; }
enabled cuvid && { add_cflags -I$source_path;
check_lib2 "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
die "ERROR: CUVID not found"; } &&
{ enabled cuda ||
die "ERROR: CUVID requires CUDA"; }

Post Reply