debrouxl / gcc4ti

GCC4TI is a complete and mature GPL SDK for the TI-89, TI-89T, TI-92+ and TI-V200 (collectively known as TI-68k) calculators in the C and ASM languages.
https://github.com/debrouxl/gcc4ti
Other
86 stars 15 forks source link

Can't include local header files #10

Open bobpaw opened 5 years ago

bobpaw commented 5 years ago

When compiling, I am unable to include local files using the include "file.h" syntax. This is even with the -I. GCC switch. The compiler always errors with "No such file or directory." I am able to compile when providing GCC with the absolute path. This leads me to believe that GCC4TI does not use the current project as the working directory (a clear error).

debrouxl commented 5 years ago

Does that occur while building a project from the Windows Delphi IDE ? It has a... peculiar way to handle relative paths, related to the usage of a temporary folder for building projects. Also, the "virtual folder"... thing. Try building the same project with tprbuilder, which does not emulate this behaviour, from the directory containing the project. Out of the box, some TPRs which can be built using the Windows IDE can't be built using tprbuilder, and vice-versa... TPRs are meant to help users build their projects with coherent sets of compiler, assembler and linker flags; however, the tigcc CLI front-end for the toolchain is much closer to a normal toolchain, more flexible and more powerful.

You can send me a copy of the project privately, and I'll take a look, but I think that what you're experiencing stems from the above :)

kkofler commented 2 years ago

The proper way to resolve that issue, if it is indeed due to using the IDE (KTIGCC behaves the exact same way, by the way), is to just add the header file to the project, instead of relying on a tprbuilder bug. (Fixing tprbuilder to build in a temporary directory just like the IDEs do is one of the things I had always meant to do in TIGCC and just never got around to. And @debrouxl does not even want to fix that bug, it seems.)