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
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
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é
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. |
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
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.