User forums > Help

PCH in object output dir (possible bug?)

<< < (2/3) > >>

starkos:
Try switching the PCH option from "obj dir" to "alongside original header"; the project will now build just fine. If the project can build under one setting, shouldn't it be able to build with the other?

You are correct, I am not using precompiled headers on this particular project. Should that prevent the project from building?

This isn't a showstopper for me, I can just configure Premake to output the "alongside original header" option always. I was just hoping to keep the behavior consistent across all of the toolsets.

Thanks,
Jason

starkos:
Just to clarify - this is not a PCH problem. If C::B had an option "don't create PCH" I would check it and leave it at that. My question is: why does this project build fine when set to "alongside original header" but not build at all when set to "object output dir"?

To clarify further - I realize I can work around this issue by adding "Lua" to the include directories. But why do I need to set up include directories for "object output dir" and not for "alongside original header"?

Thanks for the continued assistance,
Jason

tiwag:
the problem is not related to pch generation,
it's just by coincidence that the additional compiler options which were added by CB,
if you select pch in object output dir, prevent compiling or the other way round,
it coincidentally compiles if you switch to pch alongside header file.

the real necessity is ALWAYS to specify the necessary directories,
where the compiler shall look for the headers.

therefore adding Lua to the list of compiler include-directories is not a workaround, it's the correct project setup.

mandrav:

--- Quote from: tiwag on August 30, 2006, 07:03:59 pm ---therefore adding Lua to the list of compiler include-directories is not a workaround, it's the correct project setup.

--- End quote ---

Exactly.
True, when you select PCH in "object output dir", it does alter your include paths to accomodate this. But this is a side-effect (which I fail to see as a bug).
But the correct thing to do, regardless of using PCH or not (and what PCH option), is to setup the project's include dirs as needed. This will ensure correct project setup, which is then unlikely to fail.

starkos:
Thanks for your replies and your patience.

The project I attached above should not require any include directories to be set. All includes are of the form `#include "somefile.h"`. The compiler is supposed to look in the same directory as the including file; this is per the language spec.

However, I gather from your responses that this is something that GCC is doing under the hood, and is out of the control of C::B. That's fine. I just needed to understand the cause of the problem so I could choose an appropriate workaround. I'll just always set the option to "alongside original header" and leave it at that. If in the future you find time for a "No precompiled headers" option, that would be great.

Thanks again for your help. I will drop a note when the next version of Premake -- with C::B support! -- is released.

Jason

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version