Constants not linked
Constants not linked
- Subject: Constants not linked
- From: Steve Mills <email@hidden>
- Date: Tue, 28 Feb 2006 14:15:32 -0600
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:
This email sent to email@hidden