NO

Author Topic: Problem with adding files to Project  (Read 3221 times)

Offline tony74

  • Member
  • *
  • Posts: 34
Problem with adding files to Project
« on: October 05, 2024, 09:10:41 PM »
My current directory layout:

Code: [Select]
C:\sdx
     |
     extras
     source
          |
          sdx-pelles
          sdx-gcc
          sdx-vs

When adding files to Pelles project in sdx\source\sdx-pelles from sdx\source, I get an error:
 
  "Unable to add main.c to the project.
   Unknown file extension, or invalid directory."

Visual Studio builds OK and gcc is just command-line and builds fine, but Pelles doesn't want to add files.

Since I get good builds from VS and gcc, that are accessing the same files, I'm pretty sure there's nothing wrong with directory permissions or file-names.

Any insight?

 

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Problem with adding files to Project
« Reply #1 on: October 05, 2024, 09:35:03 PM »
This is a PellesC limitation, that doesn't allow files from directories above the project directory.
If you create the project in "C:\sdx" you can add any file from this directory and from those below.
Also in this case you can specify to the compiler to save generated object files and executables in any of the directories below, i.e. "C:\sdx\source\sdx-pelles".
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline tony74

  • Member
  • *
  • Posts: 34
Re: Problem with adding files to Project
« Reply #2 on: October 05, 2024, 09:51:40 PM »
Thanks, Frankie. I'll reconfig the directories to suit Pelles. I don't want to leave Pelles out of the lineup.

Ta!

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Problem with adding files to Project
« Reply #3 on: October 06, 2024, 02:44:57 AM »
Actually the 'limitation' is a very useful feature, IMO.

It allows one to ZIP up a project and send it elsewhere and whoever receives it can unzip it anywhere they want and it will be intact and fully function.

It allows one to move a project to any location without needing to change anything.

Allowing directories or files outside of the main directory would mean lot more work would be needed to retain this useful capability. 

John Z

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Problem with adding files to Project
« Reply #4 on: October 07, 2024, 11:42:14 AM »
Most of us understand relative paths, so Pelle's work with Win32 API was right choice.
Long time ago it was tested for special usage and many problems was found.
Old users in this site might remember, what scenarios was in table.
May the source be with you