cisco / openh264

Open Source H.264 Codec
BSD 2-Clause "Simplified" License
5.51k stars 1.78k forks source link

openh264 failed to build with make: *** [Makefile:164: generate-version] Error 2 on windows #3619

Open spacelg opened 1 year ago

spacelg commented 1 year ago

Hi All,

openh264 failed to build with **make: * [Makefile:164: generate-version] Error 2 on windows when using AutoBuildForWindows.bat to build. It can be reproduced on master branch 8422de8 commit. Could you please help look at this issue?

Repro steps:

  1. git clone https://github.com/cisco/openh264 F:\gitP\cisco\openh264
  2. Open a vs2019 x64 command && cd F:\gitP\cisco\openh264\build
  3. set PATH=C:\cygwin64\bin;%PATH%
  4. AutoBuildForWindows.bat ARM64-Release-ASM -vc_version=VC16

Expected result: build successfully.

Actural result: ... cl -O2 -Ob1 -Oy- -Zi -FS -GF -GS -Gy -DNDEBUG -MT -DNDEBUG -DHAVE_NEON_AARCH64 -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10 -DGENERATED_VERSION_HEADER -I./codec/api/wels -I./codec/common/inc -Icodec/common/inc -I./codec/decoder/core/inc -I./codec/decoder/plus/inc -c -Focodec/decoder/core/src/wels_decoder_thread.obj codec/decoder/core/src/wels_decoder_thread.cpp wels_decoder_thread.cpp sh ./codec/common/generate_version.sh ./ wc: config.git-hash: No such file or directory **./codec/common/generate_version.sh: line 29: syntax error: unexpected end of file make: * [Makefile:164: generate-version] Error 2 ./gmp-api: No such file or directory. You do not have gmp-api. Run make gmp-bootstrap to get the gmp-api headers. copying dll files to destination folder... FullDestDir is F:\gitP\cisco\openh264\bin\ARM64\Release current dir is: F:\gitP\cisco\openh264 DestDir is bin/ARM64/Release cp: cannot stat 'openh264.dll': No such file or directory cp: cannot stat 'openh264.lib': No such file or directory cp: cannot stat 'openh264.pdb': No such file or directory cp: cannot stat 'codec_unittest.exe': No such file or directory cp: cannot stat 'h264enc.exe': No such file or directory cp: cannot stat 'h264dec.exe': No such file or directory BuildDebugFlag =0 BuildReleaseFlag =0 BuildDebugInfo =NULL BuildReleaseInfo ="build release--succeed" aBuildFlagList is 0 0 ReturnCode is 0

d4v1d0v1c commented 1 year ago

dos2unix codec/common/generate_version.sh

dbruning commented 1 year ago

dos2unix codec/common/generate_version.sh

That will fix the issue with the unexpected end of file. Then, if you still have the gmp-api error, you'll need to go back up one directory (out of /build) and run "make gmp-bootstrap" to fix that.