[Solved] PackageException: Can not create a symbolic link for xxx not a directory

I didin’t program for five months, coma back and get this: :slight_smile: (Always seems like that.)

Resolving megaatmega2560 dependencies...
Library Manager: Installing symlink://../Arduino_Shared/DebugUtils
PackageException: Can not create a symbolic link for `../Arduino_Shared/DebugUtils`, not a directory

However this directory exists.

# [2025-10-03 09:25] maxg@um890 ~/Workspaces/PlatformIO/Projects/Arduino_Shared $ 
la
total 68
drwxrw-r--  10 maxg maxg  4096 Jun 15 23:02  .
drwxrwxrwx 111 maxg maxg  4096 Sep 15 12:12  ..
drwxrwxr-x   3 maxg maxg  4096 May  5 18:51  ChipTemp
-rw-rw-r--   1 maxg maxg 12182 Jun 11 09:11  coding_standard.markdown
drwxrwxr-x   2 maxg maxg  4096 May 23 23:42  DebugUtils
drwxrwxr-x   2 maxg maxg  4096 Jun 15 23:02  doc
drwxrwxr-x   2 maxg maxg  4096 May 23 23:41  DS18B20Reader
drwxrwxr-x   3 maxg maxg  4096 May 23 23:43  DualLED
-rw-rw-r--   1 maxg maxg 14050 May 18 09:25 'HubController Fix Response.markdown'
drwxrwxr-x   3 maxg maxg  4096 May 23 23:49  MQTTUtils
drwxrwxr-x   3 maxg maxg  4096 May 25 15:23  OnOffToggle
drwxrwxr-x   4 maxg maxg  4096 Jun  4 21:22  Retired_Refactored

My platformio.ini looks like this:

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
upload_port = /dev/ttyACM1
monitor_speed = 115200
lib_deps =
	arduino-libraries/Ethernet@^2.0.0
	knolleary/PubSubClient@^2.8
	symlink://../Arduino_Shared/DebugUtils
	symlink://../Arduino_Shared/MQTTUtils
	symlink://../Arduino_Shared/DualLED

[env]
build_flags =
    -Wall
    -Werror
    -Wunused-variable
;    -Wextra
;    -std=gnu++20 ; throws error
    -I src

I am at a loss, on how to resolve this, given that the other symbolic links work.

You can create a reply to your post and mark this as solution.

It would be great if you could share the solution with us so that others who may encounter the same problem can find it.

Well, a shot in the foot :slight_smile:

When I created a new project, the project directory which is usually set, defaulted back to the ‘Documents’ folder, hence these includes logically do not work. After moving the directory to where it belongs, and editing the VScode workspace; all is working beautifully.

1 Like