NO

Author Topic: Compile Target, SDK Updates, and .CPP files  (Read 2255 times)

severach

  • Guest
Compile Target, SDK Updates, and .CPP files
« on: September 02, 2006, 02:19:25 am »
Pelles-C 4.50.113

I need to be able to specify a compile target somewhere other than the folder the project is in. If I try to add "..\" to the target in the righthand project pane, it gets erased. However if I sneak into the .PPJ file and add it in, it stays, and it works correctly for both DLL and EXE. The IDE sets the current folder correctly when executing the EXE or the DLL host program.

I think your SDK files would get updated a lot faster if you came up with a way better than the forum to submit change requests. I can search my files for __POCC__ but there are some I'd not want to post publically nor would it be worth generating a new message each time I find one.

Pelles-C IDE is too opinionated. A .cpp file is not recognized as anything. Why can't I tell the IDE that it is to be treated as a .c file? Renaming the file forces me to change other project files that use it.

Ngan Lo

  • Guest
Re: Compile Target, SDK Updates, and .CPP files
« Reply #1 on: September 02, 2006, 06:06:54 am »
Quote from: "severach"
Pelles-C IDE is too opinionated. A .cpp file is not recognized as anything. Why can't I tell the IDE that it is to be treated as a .c file? Renaming the file forces me to change other project files that use it.

while PellesC is C only compiler, it's not make sence to open/load a cpp file.  :?

severach

  • Guest
Compile Target, SDK Updates, and .CPP files
« Reply #2 on: September 02, 2006, 06:47:45 pm »
Some compilers do not recognize C99 features until the source is compiled as C++. Sometimes this can be done with switches or by changing the extention. Having Pelles accept .cpp as a valid .c extension eliminates one more contention between compilers.

cane

  • Guest
Compile Target, SDK Updates, and .CPP files
« Reply #3 on: September 02, 2006, 07:03:07 pm »
A sensible compiler would recognize .cpp extension and treat the file as a C++ file not as a C file (even C99). You could have been fooled by the fact that some C99 features are also present in C++ (such as inline functions, // line comments, declaring variables when you need them, etc...), however the compiler would treat the C99 file as a C++ file instead (which is bad: some incompatible name decorations and variable visibility with C).

You should not rely on this behavior (changing .c into .cpp), and use the appropriate C++ compiler switch (if it exists) to ensure the C99 mode.