Link error occurred in case "matter library" used as "Local Git Repo" (CY8CKIT-062S2-43012)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TakMune
Level 4
Level 4
Distributor - Macnica (Japan)
First like given 100 sign-ins First solution authored

Hello,

I try to build "Matter_WiFi_Door_Lock" sample project.

I confirmed that the project can be built correctly when the matter library set as "Shared Git Repo".

But the project can not  be built correctly when the matter library set as "Local Git Repo".

TakMune_0-1679447900109.png

In this case, the attached file's sentences are displayed as build message.

ex. 

arm-none-eabi-g++.exe: error: C:/mtw_3_0/Matter_Wi-Fi_Door_Lock/build/APP_CY8CKIT-062S2-43012/Debug/ext/libs/matter/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.o: No such file or directory
 
Could you let me know how I can use the matter library as Local Git Repo?
 
Thanks
0 Likes
1 Solution
Giraffe1492
Level 5
Level 5
25 sign-ins 25 likes received 10 solutions authored

When you switch from a "Shared Git Repo" to a "Local Git Repo" for the Matter library, it's possible that the build system is not properly configured to find the new location of the library files. To resolve this issue, you can try the following steps:

  1. Clean the build folder: Before building the project again, make sure to clean the build folder. This ensures that any old files or references are removed, and the new build will use the updated settings.

  2. Update the project settings: After switching to a Local Git Repo, check the project settings (usually in a file like CMakeLists.txt or a similar build configuration file) to ensure that the paths for the Matter library are updated correctly. You might need to change the paths to point to the new location of the library files in your local repository.

  3. Reconfigure and rebuild the project: After updating the project settings, reconfigure the project, and rebuild it. This should help the build system locate the Matter library files in the Local Git Repo correctly.

  4. Check for missing files: If the error message still persists, double-check if the missing files mentioned in the error message (e.g., IMClusterCommandHandler.o) are present in your local Matter library. If not, it might be necessary to update or synchronize your local Git repository with the remote one.

If the issue persists after following these steps, consider providing more information about your build environment, such as the IDE or build system you are using, and any additional configurations you have made. This will help provide more targeted troubleshooting advice.

View solution in original post

0 Likes
10 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @TakMune 

When you create applications, libraries can be shared or local depending on the application and manifest.
Shared libraries are included in a mtb_shared directory, which is adjacent to your application directory.
Libraries that are local (aka, not shared) are included in the libs subdirectory inside your application’s directory. If you select Type "Local Git Repo" under the Properties tab, a new library will be created in the libs
subdirectory.

The file path for the file IMClusterCommandHandler.o is noticeably long which is created in the libs directory. According to Windows Documentation: Maximum Path Length Limitation,  the maximum length for a path on Windows is 260 characters by default. But it's usually short for ModusToolbox build system. If 260 characters are exceeded, the file system will reject the path, resulting in the error: No file or directory.

That is the reason why the file is not recognized. Can you please refer to this KBA for a workaround and check if it helps?

Thanks and Regards,
Leo

0 Likes
TakMune
Level 4
Level 4
Distributor - Macnica (Japan)
First like given 100 sign-ins First solution authored

Thank you for your reply.

The workaround did not worked.

On the premise "C:/mtw_3_0/Matter_Wi-Fi_Door_Lock/build/APP_CY8CKIT-062S2-43012/Debug/ext/libs/matter/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.o" does not generated.

Thanks

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @TakMune 

Can you please tell me what was the message that shown after executing the command

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

in the PowerShell?

Thanks and Regards,
Leo

0 Likes
TakMune
Level 4
Level 4
Distributor - Macnica (Japan)
First like given 100 sign-ins First solution authored

Hi

Below is a power-shell's output.

TakMune_0-1679547533011.png

Thanks

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @TakMune 

Have you performed rebooting after executing the command in PowerShell? If not please perform the same and then try building the project again.

Thanks and Regards,
Leo

0 Likes
TakMune
Level 4
Level 4
Distributor - Macnica (Japan)
First like given 100 sign-ins First solution authored

Hi

Yes I rebooted the PC, but the issue was not solved.

I think the cause of the issue is the object files are not generated at intended file paths.

Currently object file(IMClusterCommandHandler.o) is generated at 

"C:\mtw_3_0\Matter_Wi-Fi_Door_Lock\build\APP_CYSBSYSKIT-DEV-01\Debug\ext\mtb_shared\matter\release-v1.0.0\zzz_generated\lock-app\zap-generated\IMClusterCommandHandler.o".

 

Above path is not

"C:/mtw_3_0/Matter_Wi-Fi_Door_Lock/build/APP_CY8CKIT-062S2-43012/Debug/ext/libs/matter/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.o".

Thanks

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @TakMune 

Looks like the .o files in the path 

"C:\mtw_3_0\Matter_Wi-Fi_Door_Lock\build\APP_CYSBSYSKIT-DEV-01\Debug\ext\mtb_shared\matter\release-v1.0.0\zzz_generated\lock-app\zap-generated\IMClusterCommandHandler.o"

were already generated when the library was set as "Shared Git Repo". Please clean the project and build again.

Can you please try changing the workspace and creating the project again with the "Local Fit Repo" matter library?

Thanks and Regards,
Leo

0 Likes
TakMune
Level 4
Level 4
Distributor - Macnica (Japan)
First like given 100 sign-ins First solution authored

Hi

I changed a workspace, but it did not work.

When the "matter library" is set as "local repository", C/C++ Indexer halt at StatusIB.cpp as below. Does this have a relation to the build error?

TakMune_1-1680222547191.png

Thanks

0 Likes
Giraffe1492
Level 5
Level 5
25 sign-ins 25 likes received 10 solutions authored

When you switch from a "Shared Git Repo" to a "Local Git Repo" for the Matter library, it's possible that the build system is not properly configured to find the new location of the library files. To resolve this issue, you can try the following steps:

  1. Clean the build folder: Before building the project again, make sure to clean the build folder. This ensures that any old files or references are removed, and the new build will use the updated settings.

  2. Update the project settings: After switching to a Local Git Repo, check the project settings (usually in a file like CMakeLists.txt or a similar build configuration file) to ensure that the paths for the Matter library are updated correctly. You might need to change the paths to point to the new location of the library files in your local repository.

  3. Reconfigure and rebuild the project: After updating the project settings, reconfigure the project, and rebuild it. This should help the build system locate the Matter library files in the Local Git Repo correctly.

  4. Check for missing files: If the error message still persists, double-check if the missing files mentioned in the error message (e.g., IMClusterCommandHandler.o) are present in your local Matter library. If not, it might be necessary to update or synchronize your local Git repository with the remote one.

If the issue persists after following these steps, consider providing more information about your build environment, such as the IDE or build system you are using, and any additional configurations you have made. This will help provide more targeted troubleshooting advice.

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @TakMune ,

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Leo

0 Likes