Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nearly done building it, but need help #7

Closed
hydra3333 opened this issue May 15, 2017 · 13 comments
Closed

nearly done building it, but need help #7

hydra3333 opened this issue May 15, 2017 · 13 comments

Comments

@hydra3333
Copy link

hydra3333 commented May 15, 2017

Hello, I am trying to build the project in Visual Studio 2017.
I followed steps here https://www.olegtarasov.me/how-to-build-cuda-toolkit-projects-in-visual-studio-2017/ to ensure vs2017 and CUDA 8.0 toolkit build integration.
Then I cloned this latest nvenc source and tried to build the project as RelStatic/x64 but I receive these errors:

2>avcodec_qsv_log.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file avcodec_qsv.cpp)
2>avcodec_reader.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file avcodec_reader.cpp)
2>avcodec_writer.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file avcodec_qsv_log.cpp)
2>cl_func.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file avcodec_writer.cpp)

2>FrameQueue.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file CuvidDecode.cpp)

2>NVEncFilter.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file NVEncFeature.cpp)

2>NVEncInputRaw.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file NVEncInputAvs.cpp)
2>NVEncInputVpy.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file NVEncInputVpy.cpp)

2>NVEncOutput.cpp
2>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory (compiling source file NVEncCore.cpp)

2>Done building project "NVEncCore.vcxproj" -- FAILED.
4>------ Skipped Rebuild All: Project: NVEnc, Configuration: RelStatic x64 ------
4>Project not selected to build for this solution configuration 
5>------ Rebuild All started: Project: NVEncC, Configuration: RelStatic x64 ------
5>NVEncC.cpp
5>c:\users\u\desktop\vapoursynth\nvencc\nvenc-master\nvenccore\avcodec_qsv.h(40): fatal error C1083: Cannot open include file: 'libavutil/avutil.h': No such file or directory
5>Done building project "NVEncC.vcxproj" -- FAILED.
========== Rebuild All: 2 succeeded, 2 failed, 1 skipped ==========

Suggestions or links saying how to fix this (and address any other dependencies) would be appreciated.
I'm guessing that libav has to be downloaded from somewhere and copied into a couple of places.

Thanks !

@hydra3333
Copy link
Author

hydra3333 commented May 15, 2017

Also, is it compatible with the cuda toolkit 8.0 ?
Some of the files seem to mention 7.1, but not 8.

edit note:
when you first open the solution it proposes to re-target or something, let it.
after doing this:
https://www.olegtarasov.me/how-to-build-cuda-toolkit-projects-in-visual-studio-2017/
you WILL need to edit the solution configs so that it finds the cuda 8 extensions/

In the last step you will need to edit your Cuda projects to recognize NVidia's build tasks from Visual Studio 2017. Open your .vcxproj file in a text editor and find all occurrences of CUDA 8.0.props. Replace the macro at the beginning of the string with $(VCTargetsPath14) so that XML snippet would look as follows:

   <ImportGroup Label="ExtensionSettings">
     <Import Project="$(VCTargetsPath14)\BuildCustomizations\CUDA 8.0.props" />
   </ImportGroup>

Don't forget to edit the custom targets path at the end of the file:

   <ImportGroup Label="ExtensionTargets">
     <Import Project="$(VCTargetsPath14)\BuildCustomizations\CUDA 8.0.targets" />
   </ImportGroup>

Note: according to that documentation the cuda extension bits get copied into a different extensions folder than vsyasm which goes here
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations

@rigaya
Copy link
Owner

rigaya commented May 15, 2017

I'm using VS2015 + CUDA8.0, and have not tried VS2017.

As you have assumed, you need create new directory "ffmpeg_lgpl", and set ffmpeg components like the structure below.

I have built those ffmpeg dlls by mingw(64).

NVEnc root
 |-NVEnc
 |-NVEncC
 |-NVEncCore
 |-NVEncSDK
 |-<others>...
 `-ffmpeg_lgpl
    |- include
    |   |-libavcodec
    |   |  `- libavcodec header files
    |   |-libavfilter
    |   |  `- libavfilter header files
    |   |-libavformat
    |   |  `- libavfilter header files
    |   |-libavutil
    |   |  `- libavutil header files
    |   `-libswresample
    |      `- libswresample header files
    `- lib
        |-win32 (for win32 build)
        |  `- avocdec, avfilter, avformat, avutil, swresample
        |     x86 lib & dlls
        `- x64 (for x64 build)
           `- avocdec, avfilter, avformat, avutil, swresample
              x64 lib & dlls

@hydra3333
Copy link
Author

Ah.
Header files no probs.
LIB and DLLs are a problem as I cross-compile ffmpeg as static and that only yields ".a" files during the process.
I'll try a shared cross-compile build of ffmpeg and see what happens.

@hydra3333
Copy link
Author

Hmm, these
http://builds.libav.org/windows/nightly-lgpl/
seem to contain DLL files and the Include files although are missing libswresample which would be ffmpeg not libav I suppose.
Hmm, zeranoe "dev" downloads have ".dll.a" files (no "lib") which I'm not sure are what's needed - these are what my cross-compile would produce too so I'm a bit stuck.
Any hints ?

@rigaya
Copy link
Owner

rigaya commented May 18, 2017

When Visual Studio's environment path is set, ffmpeg will build dll & libs on shared lib build.

I first set path of Visual Studio's environment, and then run MSYS.bat.
Please note "VS140COMNTOOLS" is for VS2015, I don't know what is for VS2017.

call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
call msys.bat

Then configure ffmpeg with

--enable-swresample --enable-shared

Hope it helps.

@hydra3333
Copy link
Author

hydra3333 commented May 18, 2017

Thanks, yes I'll look into it.
I ended up sourcing the files from the zeranoe Dev build and got a bit further, then it needed

  • avisynth_c.h from ffmpeg (and then a sub-folder it uses) in NVEncCore (edit: don't use this, use the one from avisynth 2.5.8)
  • and then vapoursynth.h from vapoursynth in NVEncCore
  • and VSScript.h from vapoursynth in NVEncCore

so I expect it to not build even after copying in those since I haven't provided libraries and only ever install portable version of them.
So far it gets a bunch of link errors with seemingly mismatched project build type (i specify x64 Static) and it also seems to not find a "dtl" folder of some kind. Bedtime, so it's fun for another day.
eg

4>NVEncCore.lib(cpu_info.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncCore.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(ConvertCsp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncInput.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncUtil.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncParam.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterDenoiseKnn.cu.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(h264_level.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncInputRaw.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterDelogo.cu.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncInputVpy.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncOutput.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterResize.cu.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(hevc_level.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(avcodec_writer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterUnsharp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterDenoisePmd.cu.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterDenoiseGauss.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(avcodec_reader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(gpu_info.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncLog.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncInputAvs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilter.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFilterCrop.cu.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(ConvertCspSSE2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(ConvertCspSSSE3.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(ConvertCspAVX.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(NVEncFrameInfo.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(avcodec_qsv.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(avcodec_qsv_log.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEncCore.lib(cl_func.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(locale0.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(ios.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(iosptrs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(locale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(xlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(xthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(wlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(xlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(xdateord.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(winapisupp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(StlCompareStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(winapinls.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(StlCompareStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(StlLCMapStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>libcpmt.lib(StlLCMapStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>NVEnc.obj : warning LNK4197: export 'GetOutputPluginTable' specified multiple times; using first specification
4>   Creating library ..\_build\NVEnc\x64\RelStatic\NVEnc.lib and object ..\_build\NVEnc\x64\RelStatic\NVEnc.exp
4>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
4>NVEncCore.lib(NVEncFeature.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in auo_audio.obj
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl NVEncCore::PrintMes(int,char const *,...)" (?PrintMes@NVEncCore@@MEAAXHPEBDZZ)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl NVEncCore::GetEncodingParamsInfo(int)" (?GetEncodingParamsInfo@NVEncCore@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl NVEncBasicInput::CreateInputInfo(char const *,char const *,char const *,char const *,struct InputVideoInfo const *)" (?CreateInputInfo@NVEncBasicInput@@MEAAXPEBD000PEBUInputVideoInfo@@@Z)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "char const * __cdecl get_simd_str(unsigned int)" (?get_simd_str@@YAPEBDI@Z)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl CNVEncLog::write(int,char const *,...)" (?write@CNVEncLog@@UEAAXHPEBDZZ)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl CNVEncLog::write_log(int,char const *,bool)" (?write_log@CNVEncLog@@UEAAXHPEBD_N@Z)
4>auo_nvenc.obj : error LNK2001: unresolved external symbol "public: void __cdecl CNVEncLog::init(char const *,int)" (?init@CNVEncLog@@QEAAXPEBDH@Z)
4>frmConfig.obj : error LNK2001: unresolved external symbol "int __cdecl getCPUInfo(char *,unsigned __int64)" (?getCPUInfo@@$$FYAHPEAD_K@Z)
4>frmConfig.obj : error LNK2001: unresolved external symbol "int __cdecl getGPUInfo(char const *,char *,unsigned int,bool)" (?getGPUInfo@@$$FYAHPEBDPEADI_N@Z)
4>frmConfig.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getOSVersion(void)" (?getOSVersion@@$$FYA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidCtxUnlock
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidCtxLockCreate
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidUnmapVideoFrame64
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidCtxLock
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidCtxLockDestroy
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol "public: int __cdecl ChapterRW::read_file(wchar_t const *,unsigned int,double)" (?read_file@ChapterRW@@QEAAHPEB_WIN@Z)
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol "public: __cdecl ChapterRW::~ChapterRW(void)" (??1ChapterRW@@QEAA@XZ)
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol "public: __cdecl ChapterRW::ChapterRW(void)" (??0ChapterRW@@QEAA@XZ)
4>NVEncCore.lib(NVEncCore.obj) : error LNK2001: unresolved external symbol cuvidMapVideoFrame64
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidDestroyVideoParser
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidCreateDecoder
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidParseVideoData
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidDestroyDecoder
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidDecodePicture
4>NVEncCore.lib(CuvidDecode.obj) : error LNK2001: unresolved external symbol cuvidCreateVideoParser
4>NVEncCore.lib(NVEncInputAvs.obj) : error LNK2001: unresolved external symbol __imp_avs_get_pitch_p
4>NVEncCore.lib(NVEncInputAvs.obj) : error LNK2001: unresolved external symbol __imp_avs_get_read_ptr_p
4>..\_build\NVEnc\x64\RelStatic\NVEnc.auo : fatal error LNK1120: 27 unresolved externals
4>Done building project "NVEnc.vcxproj" -- FAILED.
5>------ Rebuild All started: Project: NVEncC, Configuration: RelStatic x64 ------
5>C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\bin\x86_amd64\CL.exe /c /I..\NVEncCore /I..\NVEncSDK /I..\NVEncSDK\Common /I..\NVEncSDK\Common\inc /I..\NVEncSDK\Core /I..\NVEncSDK\Core\include /I..\ffmpeg_lgpl\include /I..\dtl /I"C:\Program Files (x86)\Windows Kits\8.1\Include\um" /I"C:\Program Files (x86)\Windows Kits\8.1\Include\shared" /I"C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" /I\include /Zi /nologo /W4 /WX- /MP /Ox /Ob2 /Oi /Ot /Oy /GT /GL /D WIN32 /D NDEBUG /D _CONSOLE /D _LIB /D _UNICODE /D UNICODE /GF /Gm- /EHsc /MT /GS- /Gy /fp:fast /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"..\_build\NVEncC\x64\RelStatic\obj\\" /Fd"..\_build\NVEncC\x64\RelStatic\obj\vc140.pdb" /Gd /TP /wd4505 /wd4996 /wd4512 /errorReport:prompt NVEncC.cpp
5>NVEncC.cpp
5>NVEncC.cpp(51): fatal error C1083: Cannot open include file: 'dtl/dtl.hpp': No such file or directory
5>Done building project "NVEncC.vcxproj" -- FAILED.
========== Rebuild All: 3 succeeded, 2 failed, 0 skipped ==========

@rigaya
Copy link
Owner

rigaya commented May 19, 2017

I'm sorry to forget to mention about dtl.

Just clone dtl into NVEnc root, I should have added it as submodule.

NVEnc root
 |-NVEnc
 |-NVEncC
 |-NVEncCore
 |-NVEncSDK
 |-<others>...
 |-ffmpeg_lgpl
`-dtl

Also, NVEnc.auo (Release/Debug build, x86 only) is for Aviutl plugin, so if you do not require it, just build NVEncC by RelStatic/DebugStatic.

@hydra3333
Copy link
Author

hydra3333 commented May 20, 2017

Nearly there. Re-download source and applied all of the stuff above, rebuilt only nvencc and now this

4>C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"..\_build\NVEncC\x64\RelStatic\NVEncC64.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:..\ffmpeg_lgpl\lib\x64 /LIBPATH:"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64" cuda.lib nvcuvid.lib d3d9.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Delayimp.lib /DELAYLOAD:nvcuda.dll /DELAYLOAD:nvcuvid.dll /DELAYLOAD:nppi64_80.dll /DELAYLOAD:"avcodec-57.dll" /DELAYLOAD:"avformat-57.dll" /DELAYLOAD:"avutil-55.dll" /DELAYLOAD:"swresample-2.dll" /DELAYLOAD:"avfilter-6.dll" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:NVEncC.manifest /DEBUG /PDB:"..\_build\NVEncC\x64\RelStatic\NVEncC64.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\_build\NVEncC\x64\RelStatic\NVEncC64.lib" /MACHINE:X64 ..\_build\NVEncC\x64\RelStatic\obj\NVEncC_version.res
4>..\_build\NVEncC\x64\RelStatic\obj\NVEncC.obj
4>"C:\Users\u\Desktop\Vapoursynth\NVEncC\NVEnc-master\_build\tinyxml2\x64\RelStatic\tinyxml2.lib"
4>"C:\Users\u\Desktop\Vapoursynth\NVEncC\NVEnc-master\_build\ChapterRW\x64\RelStatic\ChapterRW.lib"
4>"C:\Users\u\Desktop\Vapoursynth\NVEncC\NVEnc-master\_build\NVEncCore\x64\RelStatic\NVEncCore.lib"
4>LINK : fatal error LNK1104: cannot open file 'avcodec.lib'
4>Done building project "NVEncC.vcxproj" -- FAILED.
========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========

This file exists
C:\Users\u\Desktop\Vapoursynth\NVEncC\NVEnc-master\ffmpeg_lgpl\lib\avcodec.lib
so I guess I'll need to do some poking around.

edit: I am a twit, read the folder tree list above - add subfolder "x64"

@hydra3333
Copy link
Author

hydra3333 commented May 20, 2017

so near and yet so far. 2 unresolved externals.
apologies for the newbie questions, however - what is needed to be done next ?

4>------ Rebuild All started: Project: NVEncC, Configuration: RelStatic x64 ------
4>NVEncC.cpp
4>NVEncC.cpp(569): warning C4100: 'strAppName': unreferenced formal parameter
4>   Creating library ..\_build\NVEncC\x64\RelStatic\NVEncC64.lib and object ..\_build\NVEncC\x64\RelStatic\NVEncC64.exp
4>NVEncCore.lib(NVEncInputAvs.obj) : error LNK2001: unresolved external symbol __imp_avs_get_pitch_p
4>NVEncCore.lib(NVEncInputAvs.obj) : error LNK2001: unresolved external symbol __imp_avs_get_read_ptr_p
4>..\_build\NVEncC\x64\RelStatic\NVEncC64.exe : fatal error LNK1120: 2 unresolved externals
4>Done building project "NVEncC.vcxproj" -- FAILED.
========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========

@rigaya
Copy link
Owner

rigaya commented May 20, 2017

Hmm..., wierd. You shouldn't need "avs_get_pitch_p" in dll, because it is declared directly on avisynth_c.h (around line 323),

AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
        return p->pitch;}

AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) { 
  switch (plane) {
  case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
  return p->pitch;}

I'm not sure, but maybe the version of Avisynth? I'm using header of Avisynth 2.5.8.

@hydra3333
Copy link
Author

hydra3333 commented May 20, 2017

ok thank you. copied avisynth_c.h from avisynth 2.5.8 instead of from ffmpeg or avisynth+_MT

4>LINK : warning LNK4199: /DELAYLOAD:avcodec-57.dll ignored; no imports found from avcodec-57.dll
4>LINK : warning LNK4199: /DELAYLOAD:avformat-57.dll ignored; no imports found from avformat-57.dll
4>LINK : warning LNK4199: /DELAYLOAD:avutil-55.dll ignored; no imports found from avutil-55.dll
4>LINK : warning LNK4199: /DELAYLOAD:swresample-2.dll ignored; no imports found from swresample-2.dll
4>LINK : warning LNK4199: /DELAYLOAD:avfilter-6.dll ignored; no imports found from avfilter-6.dll
4>NVEncC.vcxproj -> C:\Users\u\Desktop\Vapoursynth\NVEncC\NVEnc-master\NVEncC\..\_build\NVEncC\x64\RelStatic\NVEncC64.exe
4>NVEncC.vcxproj -> ..\_build\NVEncC\x64\RelStatic\NVEncC64.pdb (Full PDB)
4>Done building project "NVEncC.vcxproj".
========== Rebuild All: 4 succeeded, 0 failed, 0 skipped ==========

That's progress, of sorts.
Now going back to your post #7 (comment)

@rigaya
Copy link
Owner

rigaya commented May 28, 2018

I have updated "how to build", now I have added sample script to build the dlls.

@rigaya rigaya closed this as completed May 28, 2018
@hydra3333
Copy link
Author

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants