Getting "No such file or directory" linker error, but both file and directory exist.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting "No such file or directory" linker error, but both file and directory exist.

4,587 Views
raels-r
Contributor IV

In the final stages of porting a demo across into KDS, but the build keeps failing at the final linker step.

Console lists the error as:

"arm-none-eabi-g++: error: ./Sources/eGUI/eGUI_stndard_library/D4D/common_files/d4d_mouse.o: No such file or directory"

Looking in the directory I can confirm that this file exists, along with the directory.

 

It's not a path length issue as the linker command includes much longer paths, nor is it strangeness with that sub directory as the linker reports no errors about the other 14 .o files in that directory.

 

A sample of the linker command:

arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T "C:/Users/B50317/Desktop/Stick_Demo__FullSource/build/kds/frdm_kl26_attach_demo/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"C:/Users/B50317/Desktop/Stick_Demo__FullSource/build/kds/frdm_kl26_attach_demo/Project_Settings/Linker_Files" -Wl, -Map,"frdm_kl26_attach_demo.map" -o "frdm_kl26_attach_demo.elf" (...) ./Sources/eGUI/eGUI_standard_library/D4D/low_level_drivers/touch_screen/touch_screen_hw_interface/mcf52259_adc_12b/d4dtchhw_mcf52259_adc.o  // Example of much longer path (...) ./Sources/eGUI/eGUI_standard_library/D4D/common_files/d4d_math.o ./Sources/eGUI/eGUI_standard_library/D4D/common_files/d4d_mouse.o  //can't find ./Sources/eGUI/eGUI_standard_library/D4D/common_files/d4d_object.o ./Sources/eGUI/eGUI_standard_library/D4D/common_files/d4d_scheme.o (...)  arm-none-eabi-g++: error: ./Sources/eGUI/eGUI_stndard_library/D4D/common_files/d4d_mouse.o: No such file or directory make: *** [frdm_kl26_attach_demo.elf] Error 1

(I have attached the project build log where you can see the full linker command.)

 

Screenshot of folder, showing file exists:

13660_13660.pngFolder.png

Original Attachment has been moved to: frdm_kl26_attach_demo.build.log.zip

Labels (1)
0 Kudos
5 Replies

1,882 Views
raels-r
Contributor IV

Update:
This appears to be an error with the total length of arguments passed to the linker.

After removing one file from the dependencies list, the linker will call the same error on the next file of the command.

I have now slimmed down my eGUI library for this build and the linker seems to be happier with locating all the files.

for reference: the first command attempt had a command length of 9989 character. After slimming the library the command length is only 7668, which the linker seems happier with.

(i'm now getting a "region overflow" error, but I don't beleive that is related to this problem)

Hope this helps anyone with similar errors

1,883 Views
danielkraemer
Contributor II

Hi,

I`m currently developing a project on KDS on Windows and have faced the same problem.

The project has gained some complexity and uses a lot of files and folders, and it fails to build when the list of object files is being passed to the linker.

Apparently, it`s a problem related to the maximum number of characters limit on Windows batch file, which is 8191 characters. Command prompt (Cmd. exe) command-line string limitation.

On CodeWarrior, this problem has been bypassed using files to pass arguments to the linker. Review of CodeWarrior for MCU10.4 | MCU on Eclipse   

Does anybody know if there is any way to use or implement this workaround on KDS?

Thanks,

0 Kudos

1,883 Views
mauricelauze
Contributor III

Hi Daniel,

Please read KDS Static Library Project - Another Bug Report - Need Fix

I am currently facing the same problem...

Maurice

0 Kudos

1,883 Views
dave408
Senior Contributor II

Thank you for posting this.  I ran into this issue today on several projects as I have been learning how to use KDS/MQX/RTCS.  When the folder name gets truncated, I have been able to get around it with symbolic links, but now I'm at a point where I can't because the \ is getting removed!  :smileycry:

0 Kudos

1,883 Views
danielkraemer
Contributor II

Thanks Maurice,

I'll take a look.

0 Kudos