I am getting an 'unknown file extension or invalid directory' when trying to add a .c source code file to a (console) project.
The same errors occur when opening an older project. I don't see why .c files would be an unknown extension for a C compiler, or why their directory could be invalid?
What else could trigger this error?
Maybe it depends on the file location.
Starting from a couple of releases ago Pelle confined the location of project's files to subdirectories of the one where the -prj file is located.
Honestly I think that nobody on this forum understand why. This simply limit the IDE flexibility and force the use of a custom project files layout that is not found in any IDE or sample code you can download around. :P
Try to move files inside the project directory.
https://forum.pellesc.de/index.php?topic=7321.0
All the project source files must be located below the project directory.
I don't know why Pelles C still keeps creating Pelles C Projects directory on the user's Documents library (map to My Documents in user home directory). This causes so many problems! Move the Pelles C Projects directory out of the Documents library solved the problem. I suggest changing the default location of Pelles C Projects to be the user's home directory rather than the Documents library (user's My Documents).
Quote from: 1e9t8m29 on April 27, 2022, 04:52:53 PM
I don't know why Pelles C still keeps creating Pelles C Projects directory on the user's Documents library (map to My Documents in user home directory). This causes so many problems! Move the Pelles C Projects directory out of the Documents library solved the problem. I suggest changing the default location of Pelles C Projects to be the user's home directory rather than the Documents library (user's My Documents).
It is just following your instructions. When you created the project you did not specify a location. I've never had PellesC create a projects in the Document folder. See attached image to change the project location when you create one. It also saves this for the next one as I recall.
John Z