diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl
index 96122750f190a4bd5ea19ea507be59e8f8d74761..9b5bc081e16b1c39f51f6879e40355bdc2e91404 100644
--- a/src/tools/msvc/gendef.pl
+++ b/src/tools/msvc/gendef.pl
@@ -32,7 +32,7 @@ sub dumpsyms
 sub extract_syms
 {
 	my ($symfile, $def) = @_;
-	open(my $f, '<', $symfile) || die "Could not open $symfile for $_\n";
+	open(my $f, '<', $symfile) || die "Could not open $symfile for $_: $!\n";
 	while (<$f>)
 	{