Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Constants not linked



I keep having this problem with every project that I convert from CW. We have a .h file that has a bunch of constants defined like so:

#if !defined(blah_constants_h)
#define blah_constants_h
namespace blah {
const long kSomething = 0;
}
#endif

This file is #included in the .pch (via other #included files). In the first project that I made, everything was fine. But in every other project I make that #inclused this file in its .pch file (via the same #included paths as the first project), everything is fine until it links. Linking tells me that all those constants are Undefined Symbols.

My first thought was that, since they're in a namespace, they were only being linked for C++ files, but not for C files. So I changed the project settings to compile all source files as C++, and to only generate a C++ pch. That didn't work. One other thing is that the only .h files that #includes this file will only #include it inside an #if defined(__cplusplus) block.

Any idea why it's telling me they're undefined? They're clearly used throughout almost all of the source files. This is driving me nuts. No problems what so ever in all the CW projects.

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


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.