我正在嘗試使用 Windows 11 和 Visual Studio 2022 配置 OpenDDS 庫。
我通過 Visual Studio 命令提示符運行組態檔,但出現以下錯誤。
Downloading ACE TAO 2.2a with latest patches
Extracting archive ACE TAO-2.2a_with_latest_patches_NO_makefiles.zip
Use of uninitialized value $prop_value in scalar chomp at configure line 473.
Couldn't get submodule.tools/rapidjson.openddsConfigureCommit from .gitmodules
Stopped at configure line 475.
ERROR: configure failed with errorcode 1
configure.cmd 檔案有以下代碼
@echo off
:: Win32 configure script wrapper for OpenDDS
:: Distributed under the OpenDDS License.
:: See: http://www.opendds.org/license.html
for %%x in (perl.exe) do set PERLPATH=%%~dp$PATH:x
if "x%PERLPATH%"=="x" (
echo ERROR: perl.exe was not found. This script requires Perl.
exit /b 1
)
set PERLPATH=
perl configure %*
if %ERRORLEVEL% NEQ 0 (
echo ERROR: configure failed with errorcode %errorlevel%
exit /b %errorlevel%
)
if exist setenv.cmd call setenv.cmd
我相信 perl 的組態檔在這里https://github.com/objectcomputing/OpenDDS/blob/master/configure
我在 Perl 中交叉參考了這個問題“Use of uninitialized value in scalar chomp”,但不幸的是我沒有在 Perl 中編碼,所以我不知道如何解決這個問題。
uj5u.com熱心網友回復:
這是關于一個管道檔案句柄,它未能讀取它應該讀取的內容,如您鏈接的代碼中所述。第 473 行在這個相對簡短的子程式中:
sub git_submodule_prop {
my $path = shift;
my $prop_name = shift;
my $full_prop_name = "submodule.$path.$prop_name";
open(my $fd, "-|", "git config --file .gitmodules --get $full_prop_name")
or die("git_submodule_prop open failed: $!\nStopped");
my $prop_value = <$fd>;
close($fd);
chomp($prop_value);
if (!$prop_value) {
die("Couldn't get $full_prop_name from .gitmodules\nStopped");
}
return $prop_value;
}
錯誤訊息沒有說明特別值得注意的地方,只是該函式chomp用于未定義的值。“真正的”錯誤訊息在它下面:
Couldn't get submodule.tools/rapidjson.openddsConfigureCommit from .gitmodules
Stopped at configure line 475.
在代碼中,您可以看到它嘗試打開一個git行程的管道,該行程顯然確實打開了(因為它沒有在那里死掉),但是沒有從檔案句柄中讀取任何內容
my $prop_value = <$fd>;
然后導致代碼死亡。
if (!$prop_value) {
die("Couldn't get $full_prop_name from .gitmodules\nStopped");
}
也許您需要調查的是為什么該git行程沒有從管道中讀取任何內容。
uj5u.com熱心網友回復:
就像@TLP 提到的https://stackoverflow.com/a/74026678/8869703一樣,這確實是 git 的失敗。
來自 OpenDDS 的壓縮檔案不包含 git 包,所以我不能依賴來自https://opendds.org/downloads.html的檔案。
我遵循了從@simpsont-oci 的評論中找到的以下步驟https://github.com/objectcomputing/OpenDDS/discussions/3784:
git clone https://github.com/objectcomputing/OpenDDS.git- 在 OpenDDS 檔案夾中 ->
git submodule init git submodule update- 通過 VS 命令列
configure
這對我有用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/515107.html
