NO

Author Topic: Unable to add source files to project  (Read 4337 times)

David Paxton

  • Guest
Unable to add source files to project
« on: May 26, 2018, 08:50:19 AM »
Pelles newbie  with problem running on Windows 7 (64 bit)
Searched forum but could not identify anything similar

1) Start Pelles - OK

2) File>New Project >Win64 Console program
Add Project name - all OK at this point.

3) Project>Add files to Project
Identify C source file say 'TestSample.c' on system

4) Click on file to add

5) Get message box "Unable to add 'TestSample.c' to the project. Unknown file extension or invalid directory."

Do source files have to be located somewhere specific?.
I assumed that they would be copied to the directory created for project at step 2.

If I copy source file to directory created for project at step 2 I can 'add source file to project' but this
does not seem to be a sensible way of going on.

If I do File>Open> Any individual C source file this is Ok and will compile and run.
Am I missing something? Is this a bug? can anyone help?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Unable to add source files to project
« Reply #1 on: May 26, 2018, 09:55:06 PM »
Hello David, welcome to pellesC forum.
Unfortunately this is a constraint (or a limitation) of the IDE. It requires that all the project source files must be located below the project directory.
You can create whichever directory structures, but they must be below the project directory.
Header files anyway can be everywhere.
I forgot to say that adding a file to the project means to put filename in the list of files to compile and link to the project, but no file copy,or move, is made.
Of course using pomake, or batch files you can compile files wherever they are on your disk. The limitation is only relative to IDE's projects.
« Last Edit: May 26, 2018, 10:03:41 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

David Paxton

  • Guest
Re: Unable to add source files to project
« Reply #2 on: May 27, 2018, 12:43:22 PM »
Frankie
Thanks for the response. Knowing what is required i can move forward.
As you point out I think I was putting the wrong interpretation on "Adding a file to the Project".
It seems the true interpretation would read  " Adding a reference to a file already placed in the Project Folder"
I can live with this. Thanks for the help.
Regards
Dave Paxton