Forum: Compiler & IDEs Frage zu Eclipse


von Willi K. (kucky)


Lesenswert?

Hallo zusammen.
Ich möchte ein Datei z.B. Config.h in mein Projekt einfügen, ohne sie 
jedesmal includieren zu müssen.. Ich habe es mit Path and Sympols und 
Preprocessor... versucht. Weißt jemand einen Rat?

Euch allen ein schönes Weihnachtsfest
Gruß Willi

von c r (Gast)


Lesenswert?

Vielleicht verstehe ich dich falsch, aber in C(++) (?) macht man das 
nunmal per include, das hat auch nichts mit Eclipse zu tun und ich 
wüsste auch keinen Grund das anders zu machen.

#include IST übrigens eine Präprozessoranweisung

von René H. (Gast)


Lesenswert?

Willi K. schrieb:
> Hallo zusammen.
> Ich möchte ein Datei z.B. Config.h in mein Projekt einfügen, ohne sie
> jedesmal includieren zu müssen.. Ich habe es mit Path and Sympols und
> Preprocessor... versucht. Weißt jemand einen Rat?
>
> Euch allen ein schönes Weihnachtsfest
> Gruß Willi

Das hat mit Eclipse nichts zu tun. Um ein include (wenn es auch über 
n-Ecken passiert) kommst Du nicht rum.

Grüsse,
René

von Rufus Τ. F. (rufus) Benutzerseite


Lesenswert?

Das Problem lässt sich mit der gcc-Option -include lösen.
1
-include file
2
3
Process file as if "#include "file"" appeared as the first line 
4
of the primary source file. However, the first directory searched 
5
for file is the preprocessor's working directory instead of the 
6
directory containing the main source file. 
7
If not found there, it is searched for in the remainder of 
8
the "#include "..."" search chain as normal.
9
10
If multiple -include options are given, the files are included 
11
in the order they appear on the command line.

von Willi K. (kucky)


Lesenswert?

Danke für eure Antworten.
Werde alles versuchen, und mich dann zurück melden.
Gruß Willi

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.