diff --git a/macOS/mexFunction-MacOSX.map b/macOS/mexFunction-MacOSX.map
deleted file mode 100644
index 04be9d06c9c7670949c415f7d0e9e7a75c457a42..0000000000000000000000000000000000000000
--- a/macOS/mexFunction-MacOSX.map
+++ /dev/null
@@ -1 +0,0 @@
-_mexFunction
diff --git a/meson.build b/meson.build
index 78fac2c47b46c0172361ab9c456f982672afbffb..b40b178876bbfa5fc9c25b52f1a4033758613822 100644
--- a/meson.build
+++ b/meson.build
@@ -114,7 +114,7 @@ if get_option('build_for') == 'matlab'
   elif host_machine.system() == 'windows' and host_machine.cpu_family() == 'x86_64'
     mexext = 'mexw64'
     matlab_arch = 'win64'
-    export_file = meson.current_source_dir() / 'windows/mex.def'
+    export_file = matlab_path / 'extern/lib/win64/mingw64/mexFunction.def'
     export_link_arg = export_file
     if get_option('build_for') == 'matlab'
       arch_fortran_args = [ '-fno-underscoring' ]
@@ -129,7 +129,7 @@ if get_option('build_for') == 'matlab'
     else
       error('Unsupported platform')
     endif
-    export_file = meson.current_source_dir() / 'macOS/mexFunction-MacOSX.map'
+    export_file = matlab_path / 'extern/lib' / matlab_arch / 'mexFunction.map'
     export_link_arg = '-Wl,-exported_symbols_list,' + export_file
   else
     error('Unsupported platform')
diff --git a/windows/mex.def b/windows/mex.def
deleted file mode 100644
index 3793c5be29ebdbaf8047e0fc0087876811299823..0000000000000000000000000000000000000000
--- a/windows/mex.def
+++ /dev/null
@@ -1,2 +0,0 @@
-EXPORTS
-mexFunction