Cc1plus.exe: fatal error: opening output file ~D:\ ... \Marlin\Marlin.ino.cpp: No such file or directory

I have a problem trying to compile marlin firmware, every time I attempt to build on mega 2560 I get the following error, usually I get the error regardless of attempting to compile and it happens when I open the folder containing my marlin install.
My marlin install/ folder is the most up top date 2.0.X version, non bugfix, though i have tried the bugfix version and get the exact same error.
I have attempted to reinstall every thing related, VS, marlin folder, plugins, even with computer and VS restarts in between and nothing seams to work and I keep getting the same error/
any aid here would be greatly appreciated.
This is what I get in the terminal below:

PS D:\Pherouzs'\3Dprinting\marlin-shannanigans\Marlin-2.0.x> platformio run --silent -e mega2560
cc1plus.exe: fatal error: opening output file D:\Pherouzs\3Dprinting\marlin-shannanigans\Marlin-2.0.x\Marlin\Marlin.ino.cpp: No such file or directory
compilation terminated.
*** Error 1
AssertionError: :
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\", line 175:
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\johnm\.platformio\platforms\atmelavr\builder\", line 162:
    target_elf = env.BuildProgram()
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\", line 242:        
    return self.method(*nargs, **kwargs)
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 61:      
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\", line 242:        
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 121:
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\", line 242:
    return self.method(*nargs, **kwargs)
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 339:
  File "C:\Users\johnm\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\", line 242:
    return self.method(*nargs, **kwargs)
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 237:
    out_file = c.convert(ino_nodes)
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 85:
    return self.process(contents)
  File "C:\Users\johnm\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 106:
    assert self._gcc_preprocess(contents, out_file)
======================================================================================================================================= [FAILED] Took 1.25 seconds ======================================================================================================================================= 

Environment    Status    Duration
-------------  --------  ------------
mega2560       FAILED    00:00:01.250
================================================================================================================================== 1 failed, 0 succeeded in 00:00:01.250 ==================================================================================================================================PS D:\Pherouzs'\3Dprinting\marlin-shannanigans\Marlin-2.0.x> echo "done" >"C:\Users\johnm\AppData\Local\Temp\ipc"
PS D:\Pherouzs'\3Dprinting\marlin-shannanigans\Marlin-2.0.x>

Is that an apostrophe in at the start of the path? This might heavily confuse the string / path escaper.

yea so I moved my marlin folder into a directory closer to the primary D:, one without an apostrophe and that seemed to fix all my problems…
so I am unaware if it was the long file path or the apostrophe, but it is working now :p.

If Win32 NTFS Long Paths were enabled, the length of the path shouldn’t be a problem. The crucial thing is that in the cc1plus.exe error message doesn’t have the ' anymore, so that’s the smoking gun.

Maybe PlatformIO (or, SCons?) should be capable of handling the apostrophe in the case. You could open a bug report in Issues · platformio/platformio-core · GitHub to have this addressed.