| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Well, there's a very simple explanation. const definitions are code, and gcc stops precompiling headers when it reaches the first line of code.
Precompiled headers are applied as a prefix to every source file in your target. So if gcc emitted code for these const definitions in the pch, you'd have multiple definitions of the constants, one for every source file. The linker wouldn't like that.
You have two choices:
1) Use macros instead of const declarations.
2) Declare the consts as "extern" in your precompiled header, and do the formal definitions in a single source file in your build (not in a header file or the prefix file).
| References: | |
| >Precompiled header problem (From: "Jeff Schmidt" <email@hidden>) | |
| >Re: Precompiled header problem (From: Chris Espinosa <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.