diff --git src/tools/msvc/gendef.pl src/tools/msvc/gendef.pl
index 9c37107..ddfe187 100644
--- src/tools/msvc/gendef.pl
+++ src/tools/msvc/gendef.pl
@@ -4,6 +4,7 @@ use warnings;
 use strict;
 use 5.8.0;
 use List::Util qw(max);
+use File::Spec::Functions qw(splitpath catpath);

 #
 # Script that generates a .DEF file for all objects in a directory
--- src/tools/msvc/gendef.pl
+++ src/tools/msvc/gendef.pl
@@ -15,9 +15,11 @@ use File::Spec::Functions qw(splitpath catpath);
 sub dumpsyms
 {
 	my ($objfile, $symfile) = @_;
-	system("dumpbin /symbols /out:symbols.out $_ >NUL")
+	my ($symvol, $symdirs, $symbase) = splitpath($symfile);
+	my $tmpfile = catpath($symvol, $symdirs, "symbols.out");
+	system("dumpbin /symbols /out:$tmpfile $_ >NUL")
 	  && die "Could not call dumpbin";
-	rename("symbols.out", $symfile);
+	rename($tmpfile, $symfile);
 }
 
 # Given a symbol file path, loops over its contents
