When using Simulink Real-Time, I am attempting to include some custom code with custom libraries as part of the build process. When I attempt to build the model, the following error is generated:
This signifies that the libraries that are being used are 64-bit, but the target machine needs to use 32-bit libraries. I then switch over to use the 32-bit libraries, and when I attempt to build the following error is generated:
link.exe /nologo /dll /MANIFEST /OPT:NOREF /export:mexFunction /export:mexfilerequiredapiversion /OUT:test_sfun.mexw64 /map:"test_sfun.map"
C:custom_pathcustom_library32.lib : warning LNK4272: library machine type "X86" conflicts with target machine type "x64"
NMAKE : fatal error U1077: ""C:Program Files (x86)Microsoft Visual Studio 14.0VCBinamd64link.exe"" : return code "0x460"
I know that both of the libraries work with my custom code because I was able to compile using Microsoft Visual Studio 14.0 for both platforms, 64-bit and 32-bit.

You are watching: Module machine type x64 conflicts with x86


*

The Simulink Real-Time target is a 32-bit target, while the Simulink Model executed on a 64-bit host. For this reason, both the 32-bit and 64-bit libraries need to be provided for the build step of the application.
The easiest way to do this is to use legacy_code tool: https://www.hyakkendana-hashigozake.com/help/simulink/slref/legacy_code.html
Utilizing this tool, the libraries can be set individually for both the host and target using the following options:
HostLibFiles — A cell array of character vectors specifying library files required for host compilation. You can specify the library files using absolute or relative path names.
TargetLibFiles — A cell array of character vectors specifying library files required for target (that is, standalone) compilation. You can specify the library files using absolute or relative path names.

Community Treasure Hunt

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

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


×
*

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other hyakkendana-hashigozake.com country sites are not optimized for visits from your location.

See more: Beats Solo 2 Wireless Not Turning On, Reset Solo2 Wireless


hyakkendana-hashigozake.com

Accelerating the pace of engineering and science

hyakkendana-hashigozake.com is the leading developer of mathematical computing software for engineers and scientists.