Borrar filtros
Borrar filtros

compiling a 32-bit C Shared Library

7 visualizaciones (últimos 30 días)
John Anderson
John Anderson el 24 de Mayo de 2018
Comentada: Fahimeh Dehghandehnavi el 4 de Mzo. de 2022
Hi all,
I need to compile a 32-bit C shared library to deploy some Matlab Code. I have installed Matlab 2015b on a 32-bit Machine running windows 10. However, I am having trouble locating a compatible 32-bit compiler. Does anyone have any pointers to a (preferably) free compiler that would be recognized by this version of Matlab. I have tried searching for the recommended compilers given under https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/SystemRequirements-Release2015b_SupportedCompilers.pdf specifically "Microsoft Windows SDK 7.1 Available at no charge; requires .NET Framework 4." but to no avail. Any tips would be much appreciated.
Best wishes,
John

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Mayo de 2018
SDK 7.1 is your only option. It is, however, not easy to install on Windows 10. You could experiment with the work-around described at https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1de7c9b4-1feb-4c98-b426-f7f02cbafa99/windows-sdk-71-on-windows-10?forum=windowssdk
  4 comentarios
John Anderson
John Anderson el 25 de Mayo de 2018
Hi all,
So the installation I had attempted of Windows SDK 7.1 has a known problem in that the compilers are sometimes uninstalled during the installation. This requires you to run this patch
https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4422
However, this fails unless .NET 4.7.2 is installed. I had thought I had already done this but must have been in a previous life. Anyway I installed from here
https://www.microsoft.com/net/download/thank-you/net472?survey=false
And then successfully installed the patch.
Now Matlab detects the alternative compiler.
mex -setup
To choose a different C compiler, select one from the following:
lcc-win32 mex -setup:'C:\Program Files\MATLAB\R2015b\bin\win32\mexopts\lcc-win32.xml' C
Microsoft Windows SDK 7.1 (C) mex -setup:C:\Users\John\AppData\Roaming\MathWorks\MATLAB\R2015b\mex_C_win32.xml C
And I am able to compile a 32-bit C Shared library ... finally.
Thanks again for your initial tip Walter.
Best wishes,
John
Fahimeh Dehghandehnavi
Fahimeh Dehghandehnavi el 4 de Mzo. de 2022
Thank you Walter! This workaround solved my problem too!

Iniciar sesión para comentar.

Más respuestas (1)

yalin kou
yalin kou el 7 de Oct. de 2018
We have a same trouble!

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Productos


Versión

R2015b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by