On May 22, 2007, at 9:47 AM, Micah Sharp wrote: I recall we were told that with Objective-C we needed to have unique class or interface names, but does this hold true for functions as well?
We have 3 plugins that all share a templated function, and it REALLY seems like one plugin is calling the function compiled a 2nd plugin. We think this because, if we add "return 0" at the top of the function, but only rebuild one plugin, the code still executes! If we rename the function to something unique, then it correctly returns 0 and does nothing. Another interesting thing is we had been having problems stepping into the code to debug, but after the rename, it suddenly has no problem at all.
Is that possible?
Micah, The problem we talked about is only with Objective-C class names. It doesn't affect method names, as those are always resolved at runtime in Objective-C, and it doesn't affect C or C++ function, method, or class names, as they are resolved at compile or link time. However, you can still run into a problem that looks like the same thing, but isn't, with C or C++. I believe what's happening is that the linker is finding an older version of the library containing templated method your code is calling. If you do a full clean and rebuild of your filter, you'll probably find that it works correctly. I think this occurs when you have 1 directory that you put all of your intermediate files into, regardless of the project that they belong to. But I'm not positive. Do you have your project set up to output intermediate files to some common directory that is shared with other projects? You might ask on the xcode user's list, too. I know this has come up before. You can sign up here:
But basically, it's an Xcode configuration issue, and not a language problem, as far as I know.
Darrin
|