Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Handling of PCH / forced includes by indexer

Hello,

 

I have the same problem with CDT v8.1: I have activated the checkmark of Display “Include Files” tab in Preferences -> C/C++ -> Property Page Settings but I cannot find such a tab in in C/C++ -> Paths and Symbols of the project properties. Can you tell me where’s the right place to find this tab?

 

Best regards

  Ralf Ebert

--

mailto: Ralf.Ebert@xxxxxxxxxx

Elster GmbH

Entwicklung Elektronik-Systeme

Steinernstrasse 19-21, 55252 Mainz-Kastel Deutschland

 

T +49 6134 605-0
F +49 6134 605-11169 

 

Von: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] Im Auftrag von Andrew Gvozdev
Gesendet: Dienstag, 14. Februar 2012 00:00
An: CDT General developers list.
Betreff: Re: [cdt-dev] Handling of PCH / forced includes by indexer

 

There is "Include Files" tab in Paths&Symbols which can show up if you enable it in Preferences->C/C++->Property Pages Settings. It is supposed to define pre-included files.

 

Andrew

On Mon, Feb 13, 2012 at 5:52 PM, Dmitry Nezhevenko <dion@xxxxxxxxx> wrote:

On Mon, Feb 13, 2012 at 02:41:02PM -0800, Sergey Prigogin wrote:
> Doing this with additional header files was wrong to begin with. The
> supported way of letting CDT parser know about includes and defines is
> through Paths and Symbols preference settings. See also Discovery Options
> preference page.

I've double checked both options. It's possible to specify where to look
for includes or to specify some "global" definitions, that are passed as
"-D" to compiler.

But my case is a bit different. For example if I've followed c++ file:

       #include <iostream>

       int main()
       {
               my_log("Hello world!");
               return 0;
       }

It definitely will not be compiled/parsed since my_log() function is not
defined.

But if I try to compile it using followed command-line call:

       gcc -include my_globals.h main.cpp

it'll be compiled correctly. "-include" behavior is like writing #include
as first line of source file.

It looks like now it's impossible to get same behavior. The best that can
be done is to add -include to discovery options that will import at least
preprocessor definitions (but not typedefs, function declarations, etc)


--
WBR, Dmitry


Elster GmbH

Geschaeftsfuehrer (Managing Directors): Michael Calovini, Ralf Geiger, Ralf Schuler.

Vorsitzender des Aufsichtsrates (Chairman of the Supervisory Board): Simon Beresford-Wylie.

Sitz (Registered Office): Wiesbaden; Amtsgericht (Local court) Wiesbaden HRB 22631

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

 


Back to the top