Packaging error of Unreal Engine project

I am trying to package Unreal Engine project with the Mathworks plugin. I cannot accomplish this even with otherwise empty project. I get this error: PackagingResults: Error: Unknown Error
Packaging (Windows): [1/3] Compile [x64] CompileTest.cpp
Packaging (Windows): [2/3] Link [x64] CompileTest.exe
Packaging (Windows): Module.MathWorksSimulation.5.cpp.obj : error LNK2005: Symbol "void __cdecl StdFree(void *)" is already defined in CompileTest.cpp.obj
Packaging (Windows): Module.MathWorksSimulation.5.cpp.obj : error LNK2005: Symbol "void * __cdecl StdMalloc(unsigned __int64, unsigned __int64)" is already defined in CompileTest.cpp.obj
Packaging (Windows): Module.MathWorksSimulation.5.cpp.obj : error LNK2005: Symbol "void * __cdecl StdRealloc(void *, unsigned __int64, unsigned __int64)" is already defined in CompileTest.cpp.obj
Packaging (Windows): Creating library CompileTest.lib and export CompileTest.exp
Packaging (Windows): fatal error LNK1169: one or more multiply defined symbols found
I have removed user specific paths from the error message.
I am also getting these warnings about missing directories, which I wasn't able to resolve. The folders seem to exist in different places than expected.
Packaging (Windows): Referenced directory 'C:\Program Files\Epic Games\UE_5.3\Engine\Source\MathWorksSimulation' does not exist.
Packaging (Windows): MATLABROOT_RAYTRACING environment variable appears unset; defaulting to MATLABROOT
Packaging (Windows): MATLABROOT (MathWorksRaytracing): C:\Program Files\MATLAB\R2024b
Packaging (Windows): Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\ray_intersect\export\include' does not exist.
Packaging (Windows): Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\ray_path_geometry\export\include' does not exist.
Packaging (Windows): Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\sensorsim_core\export\include' does not exist.
Packaging (Windows): MATLABROOT (MathWorksSimulation): C:\Program Files\MATLAB\R2024b
PackagingResults: Warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.3\Engine\Source\MathWorksSimulation' does not exist.
PackagingResults: Warning: Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\ray_intersect\export\include' does not exist.
PackagingResults: Warning: Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\ray_path_geometry\export\include' does not exist.
PackagingResults: Warning: Referenced directory 'C:\Program Files\MATLAB\R2024b\toolbox\shared\sensorsim_core\export\include' does not exist.
Packaging (Windows): Referenced directory 'C:\Program Files\Epic Games\UE_5.3\Engine\Source\MathWorksSimulation' does not exist.
Packaging (Windows): Writing manifest to C:\Users\User\Documents\SKA\analysis\unrealexperiments\CompileTest\Intermediate\Build\Manifest.xml
Packaging (Windows): Building CompileTest...
Packaging (Windows): Using Visual Studio 2022 14.36.32548 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532) and Windows 10.0.26100.0 SDK (C:\Program Files (x86)\Windows Kits\10).
PackagingResults: Warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.3\Engine\Source\MathWorksSimulation' does not exist.
How do I resolve these issues?
In the editor everything works as expected, the game runs

3 Comments

Excuse me.
i met this question too,
for this msg :
fatal error LNK1181: ޷ļC:\MATLAB\R2024a\lib\win64\ray_intersect.lib
should I install some toolbox that include the ray_intersect.lib?
UATHelper: Packaging (Windows): LINK : fatal error LNK1181: ޷ļC:\MATLAB\R2024a\lib\win64\ray_intersect.lib
UATHelper: Packaging (Windows): [32/32] WriteMetadata AutoVrtlEnv.target cancelled
LogSlate: Last resort fallback font was requested. Font: '../../../Engine/Content/Slate/Fonts/DroidSansFallback.ttf', Character: '޷ (U+07b7)'
LogSlate: Took 0.006149 seconds to synchronously load lazily loaded font '../../../Engine/Content/SlateDebug/Fonts/LastResort.ttf' (5269K)
UATHelper: Packaging (Windows): Took 120.9428982s to run dotnet.exe, ExitCode=6
UATHelper: Packaging (Windows): UnrealBuildTool failed. See log for more details. (C:\Users\ASUS\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.1\UBT-AutoVrtlEnv-Win64-Development_2.txt)
UATHelper: Packaging (Windows): AutomationTool executed for 0h 2m 2s
UATHelper: Packaging (Windows): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Windows): BUILD FAILED
PackagingResults: Error: Unknown Error
LogAudioMixer: Warning: Decoder Error, stopping source [CompileFailed]
and
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Source\MathWorksAerospace\MathWorksAerospace.Build.cs: warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.1\Engine\Source\MathWorksSimulation' does not exist.
UATHelper: Packaging (Windows): MATLABROOT_RAYTRACING environment variable appears unset; defaulting to MATLABROOT
UATHelper: Packaging (Windows): MATLABROOT (MathWorksRaytracing): C:\MATLAB\R2024a
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Source\MathWorksRaytracing\MathWorksRaytracing.Build.cs: warning: Referenced directory 'C:\MATLAB\R2024a\toolbox\shared\ray_intersect\export\include' does not exist.
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Source\MathWorksRaytracing\MathWorksRaytracing.Build.cs: warning: Referenced
directory 'C:\MATLAB\R2024a\toolbox\shared\ray_path_geometry\export\include' does not exist.
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Source\MathWorksRaytracing\MathWorksRaytracing.Build.cs: warning: Referenced directory 'C:\MATLAB\R2024a\toolbox\shared\sensorsim_core\export\include' does not exist.
UATHelper: Packaging (Windows): Library 'C:\MATLAB\R2024a\lib\win64\ray_intersect.lib' was not resolvable to a file when used in Module 'MathWorksRaytracing', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning.
UATHelper: Packaging (Windows): Library 'C:\MATLAB\R2024a\lib\win64\ray_path_geometry.lib' was not resolvable to a file when used in Module 'MathWorksRaytracing', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning.
UATHelper: Packaging (Windows): Library 'C:\MATLAB\R2024a\lib\win64\sensorsim_core.lib' was not resolvable to a file when used in Module 'MathWorksRaytracing', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning.
UATHelper: Packaging (Windows): MATLABROOT (MathWorksSimulation): C:\MATLAB\R2024a
PackagingResults: Warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.1\Engine\Source\MathWorksSimulation' does not exist.
PackagingResults: Warning: Referenced directory 'C:\MATLAB\R2024a\toolbox\shared\ray_intersect\export\include' does not exist.
PackagingResults: Warning: Referenced directory 'C:\MATLAB\R2024a\toolbox\shared\ray_path_geometry\export\include' does not exist.
PackagingResults: Warning: Referenced directory 'C:\MATLAB\R2024a\toolbox\shared\sensorsim_core\export\include' does not exist.
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Source\MathWorksUAV\MathWorksUAV.Build.cs: warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.1\Engine\Source\MathWorksSimulation' does not exist.
UATHelper: Packaging (Windows): Parsing headers for AutoVrtlEnv
UATHelper: Packaging (Windows): Running Internal UnrealHeaderTool C:\Users\ASUS\Documents\carSim\AutoVrtlEnv\AutoVrtlEnv.uproject C:\Users\ASUS\Documents\carSim\AutoVrtlEnv\Intermediate\Build\Win64\AutoVrtlEnv\Development\AutoVrtlEnv.uhtmanifest -WarningsAsErrors -installed
PackagingResults: Warning: Referenced directory 'C:\Program Files\Epic Games\UE_5.1\Engine\Source\MathWorksSimulation' does not exist.

Thank you all! I solved my problem by installing MATLABupdatepackage7

Great, thanks for the update! @Tang

Sign in to comment.

Answers (1)

Hi kamarsto,
I just wanted to make sure you have followed all the instructions on this page when creating the executable? https://www.mathworks.com/help/sl3d/package-custom-scenes-into-executable.html
There might be specific instructions there that could help avoid these errors. Let me know if you are still running into issues after reviewing that page.
Nishan

9 Comments

Yes, I have tried following the steps in that page. I did that again now. It did not resolve my issue. Even the warnings persist.
Thanks for confirming! Looks like this issue may have appeared in R2024b. Can you verify you are using the newest version of R2024b that might have a fix for this issue? Please install any new updates then download the support package and copy plugins etc once again.
Also, please check your <project name>.Target.cs file. It should not have the following lines:
GlobalDefinitions.Add("FORCE_ANSI_ALLOCATOR=1");
GlobalDefinitions.Add("UE_USE_MALLOC_FILL_BYTES=0");
There are no such lines in the Target.cs file. Updating the R2024b matlab and reinstalling the plugin did not resolve the issue. Could you explain what you mean by copying the plugins? As they are installed in the Unreal Engine's plugin directory. So I assumed that's within: "Located in the Unreal Engine installation area" mentioned in the walkthrough
Sorry to hear that reinstaling hasn't seemed to work so far.
Usually plugins are downloaded in the ProgramData folder by default when you download the support package: C:\ProgramData\MATLAB\SupportPackages\R2024b\toolbox\shared\sim3dprojects\spkg\plugins
For co-simulating with the Unreal Editor, the instructions ask to use the sim3d.utils.copyExampleSim3dProject function to copy these plugins into the correct Unreal Engine installation directory (C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\Mathworks)and create a sample project.
You might have already done this, but just to make sure:
  1. Delete old plugins in ProgramData path above
  2. Download fresh support package (for R2024b)
  3. Delete "Mathworks" folder under Plugins/Marketplace
  4. Run copyexampleSim3dProjects to plugins
It might be good to verify that the plugins are all indeed in this directory: C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\Mathworks
Hopefully the above helps. I'm looking into this a bit more in parallel, but if I don't have a solution for you, please reach out to support@mathworks.com to get additional support here. I apologize this hasn't been straightforward for you.
Nishan
After adding the mentioned lines to the Target file I managed to get a different set of errors when packaging or cooking. I did not have the toolboxes connected with driving installed, but installing them did not resolve it.
UATHelper: Cooking (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport_C:UserConstructionScript:CallFunc_GetDataTableRowFromName_OutRow'. Unknown structure.
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Road Import Struct no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin X no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Y no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Z no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] No Struct in Break <unknown struct> from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/SplineMeshImport.SplineMeshImport
UATHelper: Cooking (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport_C:AreTablesEqual:CallFunc_GetDataTableRowFromName_OutRow'. Unknown structure.
UATHelper: Cooking (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport_C:AreTablesEqual:CallFunc_GetDataTableRowFromName_OutRow_1'. Unknown structure.
UATHelper: Cooking (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport_C:Refresh:CallFunc_GetDataTableRowFromName_OutRow'. Unknown structure.
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Road Import Struct no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin X no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Y no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Z no longer exists on node Break <unknown struct> . Please refresh node or break links to remove pin. from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport
UATHelper: Cooking (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] No Struct in Break <unknown struct> from Source: /MathWorksSimulation/Landscape/Roads/GeneratorUsage/RoadImport.RoadImport
UATHelper: Cooking (Windows): LogInit: Display: LogCook: Warning: 'ProjectSettings -> PackagingSettings -> Directories to always cook' has invalid element '/DatasmithRuntime/Materials'
UATHelper: Cooking (Windows): LogInit: Display: LogCook: Warning: 'ProjectSettings -> Directories to never cook -> Directories to always cook' has invalid element '/DatasmithRuntime/Materials'
UATHelper: Cooking (Windows): LogInit: Display: LogUObjectGlobals: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Characters\Bob\Mesh\SM_Bob.uasset: Failed to load '/Game/Environment/Characters/Humans/Bob/Material/_Body_Low': Can't find file.
UATHelper: Cooking (Windows): LogInit: Display: LogLinker: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Characters\Bob\Mesh\SM_Bob.uasset: VerifyImport: Failed to load package for import object 'Package /Game/Environment/Characters/Humans/Bob/Material/_Body_Low'
UATHelper: Cooking (Windows): LogInit: Display: LogUObjectGlobals: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Landscape\Roads\GeneratorUsage\SplineMeshImport.uasset: Failed to load '/Game/Environment/Industrial/Road/Build/RoadImportStruct': Can't find file.
UATHelper: Cooking (Windows): LogInit: Display: LogLinker: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Landscape\Roads\GeneratorUsage\SplineMeshImport.uasset: VerifyImport: Failed to load package for import object 'Package /Game/Environment/Industrial/Road/Build/RoadImportStruct'
UATHelper: Cooking (Windows): LogInit: Display: LogUObjectGlobals: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Landscape\Roads\GeneratorUsage\MarkerMaterial.uasset: Failed to load '/Game/Environment/Industrial/Road/FourLaneRoad/Textures/T_FourLaneRoad_N_2': Can't find file.
UATHelper: Cooking (Windows): LogInit: Display: LogLinker: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Landscape\Roads\GeneratorUsage\MarkerMaterial.uasset: VerifyImport: Failed to load package for import object 'Package /Game/Environment/Industrial/Road/FourLaneRoad/Textures/T_FourLaneRoad_N_2'
UATHelper: Cooking (Windows): LogInit: Display: LogMaterial: Warning: [AssetLog] C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\MathWorks\MathWorksSimulation\Content\Landscape\Roads\GeneratorUsage\MarkerMaterial.uasset: Failed to compile Material for platform PCD3D_SM6, Default Material will be used in game.
UATHelper: Cooking (Windows): (Node TextureSampleParameter2D) Param2D> Found NULL, requires Texture2D
Olgierd
Olgierd on 3 Jun 2025
Edited: Olgierd on 3 Jun 2025
I do not see the "Landscape" directory though. With what toolbox is it connected?
In your Content Browser do you see the directory on this path?
All > Engine > Plugins > MathWorks Interface Content > Landscape
To ensure the plugin content is visible in the Content Browser. Under View Options, check the Show Engine Content and Show Plugin Content check boxes.
Yes, it is visible and has content
Can you try packaging an executable with the untouched example project? This might help narrow down if there are any issues with your project, or whether your environment is not set up correctly. If this doesn't help you narrow down the issue, I'd recommend reaching out to support@mathworks.com and providing your project and output log so that the support team can investigate further.
Apologies that I couldn't help resolve your issue here.
Nishan

Sign in to comment.

Categories

Products

Release

R2024b

Asked:

on 1 Jun 2025

Commented:

on 22 Sep 2025

Community Treasure Hunt

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

Start Hunting!