Installation difficulties (again). So I had a chance to have another go around at this, as I replaced my SSD in my machine.
So starting with a new, formatted SSD, I installed SDCC, Codeblocks and Python to my D: drive, in D:\Program FIles. When configuring Codeblocks, I came across similar (if not the same) issues as my first install. This is not MTXLib's problem, this is a Windows 11/Codeblocks issue I think.
I used the Codeblocks "Autodetect" feature to find the SDCC toolchain. This worked fine, it detected the executables fine and listed SDCC as found. However, there were three issues.
Problem #1
Not finding SDCC during a build. See:
Code: Select all
Project/Target: "demo - Release":
The compiler's setup (Small Device C Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?!
Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->Small Device C Compiler->Toolchain executables" and fix the compiler's setup.
Tried to run compiler executable '"D:\Program Files\SDCC"/bin/sdcc.exe', but failed!
Skipping...
Nothing to be done (all items are up-to-date).
Although it doesn't look like it, I believe this is related to the lack of 8.3 shortnames on the volume. This is defaulted to be off on NTFS volumes in WIndows 11, as it's a minor performance benefit. Now on my original drive, 8.3 shortnames were off for my volumes, however for this drive (maybe after a Windows update maybe), this drive has shortname support on a volume by volume basis:
Code: Select all
C:\Windows\System32>fsutil 8dot3name query D:
The volume state is: 0 (8dot3 name creation is ENABLED)
The registry state is: 2 (Per volume setting - the default)
Based on the above settings, 8dot3 name creation is ENABLED on "D:"
C:\Windows\System32>
It's switched on, so, what's the problem? Well, it seems that when it is switched on, it doesn't create shortnames for existing files and directories that have been created already:
Code: Select all
D:\>dir /x
Volume in drive D is WINMAX2_DATA
Volume Serial Number is A650-2C70
Directory of D:\
14/01/2023 21:40 <DIR> Backup
15/01/2023 21:39 <DIR> DELIVE~1 DeliveryOptimization
18/03/2023 17:56 <DIR> gee
14/01/2023 20:30 <DIR> memu
18/03/2023 17:18 <DIR> Program Files
20/02/2023 19:57 <DIR> Program Files (x86)
18/03/2023 17:22 <DIR> temp
14/01/2023 20:29 <DIR> Utils
15/01/2023 21:33 <DIR> WINDOW~1 WindowsApps
07/01/2023 20:39 <DIR> WINMAX~1 winmax-drivers
21/11/2022 21:23 <DIR> winmax-tools
0 File(s) 0 bytes
The D:\Program Files has no shortname. So, I renamed this directory and created a new "Program Files" directory. Then copied the contents of the old directory over to the new one.
Code: Select all
D:\>dir /x
Volume in drive D is WINMAX2_DATA
Volume Serial Number is A650-2C70
Directory of D:\
14/01/2023 21:40 <DIR> Backup
15/01/2023 21:39 <DIR> DELIVE~1 DeliveryOptimization
18/03/2023 17:56 <DIR> gee
14/01/2023 20:30 <DIR> memu
18/03/2023 21:33 <DIR> PROGRA~1 Program Files
20/02/2023 19:57 <DIR> Program Files (x86)
18/03/2023 17:22 <DIR> temp
14/01/2023 20:29 <DIR> Utils
15/01/2023 21:33 <DIR> WINDOW~1 WindowsApps
07/01/2023 20:39 <DIR> WINMAX~1 winmax-drivers
21/11/2022 21:23 <DIR> winmax-tools
You can see there is a shortname for "Program FIles" Then I went back to Codeblocks and autodected the toolchain again. The problem now moves to a new issue, the compiler is running but linking is failing.
Problem #2
Search directories are pointing to C:, thus builds fail. Both includes and linker settings were wrong, that's
Code: Select all
C:\Program FIles\sdcc\include
C:\Program Files\sdcc\lib
See in the build logs:
Code: Select all
D:\gee\Python\Python311\python.exe ..\MTXLib\tools\sdlk.py -L"C:\Program Files\sdcc\lib" -o bin\demo.exe --no-std-crt0 -mz80 --opt-code-speed --no-std-crt0 -mz80 --std-sdcc11 --code-loc 0x8000 ../MTXLib/lib/crt0.rel ..\MTXLib\lib\MTXLib.lib obj\main.rel obj\screen1.rel obj\screen2.rel obj\screen3.rel obj\screen4.rel obj\screen5.rel obj\screen6.rel obj\screen7.rel
Easily fixed. You have to switch to the "Search Directories" tab and set the "Compiler" and "Linker" directories correctly.
Problem #3
Python doesn't work although it has been installed.
Windows 11 has a directory called WindowsApps which is in the path and has Python 3 executables that starts up the Microsoft Appstore so you can install from there. I always get my installs from the source project as MS store builds usually lag the real deal.
Code: Select all
D:\>dir c:\Users\steph\AppData\Local\Microsoft\WindowsApps\py*
Volume in drive C is WINMAX2_BOOT
Volume Serial Number is 6649-A71A
Directory of c:\Users\steph\AppData\Local\Microsoft\WindowsApps
28/01/2023 12:02 0 python.exe
28/01/2023 12:02 0 python3.exe
2 File(s) 0 bytes
0 Dir(s) 221,878,714,368 bytes free
So you have to move the Python path in your PATH variable in your environment vars, to be in front of this directory in the path (maybe you could remove it - who knows what WIndows magic might break, though). Easily done.
Hope this helps anyone who comes across similar problems on a Windows 11 setup. I think it's partly related to me choosing to put my installations on drive D: and also becuase of the lack of shortname support. Anyway, it might help someone in the future.