Re: linker error nonsense?
Re: linker error nonsense?
- Subject: Re: linker error nonsense?
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 Oct 2015 11:50:44 -0700
You inadvertently changed RangeEditor.m from Objective-C++ to Objective-C when you removed and re-added it:
- CDE3EE891804C87A00201967 /* RangeEditor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RangeEditor.m; sourceTree = "<group>"; };
+ CDBE2D1A1BDFEA7A000BE921 /* RangeEditor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RangeEditor.m; path = Menus/MenuItems/Widgets/RangeEditor/RangeEditor.m; sourceTree = "<group>"; };
So now when RangeEditor.m calls ‘clamp’ it doesn’t mangle the name, i.e. it creates an external reference to a symbol called ‘_clamp’. But utils.m is an Objective-C++ file so it implements ‘clamp’ with a C++-mangled name. Thus the link error.
IMHO it’s better to make the language explicit in the filename by using “.mm” for Objective-C++ source files. It prevents this kind of confusion.
—Jens |
_______________________________________________
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