cc1obj: error: type '({anonymous})' does not have a known size , Xcode
huh?
google returns nothing on what this error is... All I am doing is adding a movieplayercontroller to a flipside iphone app.
cc1obj: error: type '({anonymous})' does not have a known size
{standard input}:228:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_9" minus "L00000000004$pb"
{standard input}:228:symbol: "L_OBJC_SELECTOR_REFERENCES_9" can't be undefined in a subtraction expression
{standard input}:218:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_8" minus "L00000000004$pb"
{standard input}:218:symbol: "L_OBJC_SELECTOR_REFERENCES_8" can't be undefined in a subtraction expression
{standard input}:215:non-relocatable subtraction expression, "L_OBJC_CLASS_REFERENCES_2" minus "L00000000004$pb"
{standard input}:215:symbol: "L_OBJC_CLASS_REFERENCES_2" can't be undefined in a subtraction expression
{standard input}:207:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_7" minus "L00000000004$pb"
{standard input}:207:symbol: "L_OBJC_SELECTOR_REFERENCES_7" can't be undefined in a subtraction expression
{standard input}:203:non-relocatable subtraction expression, "L_OBJC_CLASS_REFERENCES_1" minus "L00000000004$pb"
{standard input}:203:symbol: "L_OBJC_CLASS_REFERENCES_1" can't be undefined in a subtraction expression
{standard input}:151:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_6" minus "L00000000003$pb"
{standard input}:151:symbol: "L_OBJC_SELECTOR_REFERENCES_6" can't be undefined in a subtraction expression
{standard input}:147:non-relocatable subtraction expression, "L_OBJC_CLASS_FlipsideViewController" minus "L00000000003$pb"
{standard input}:147:symbol: "L_OBJC_CLASS_FlipsideViewController" can't be undefined in a subtraction expression
{standard input}:116:non-relocatable subtraction expression, "L_OBJC_SELECTOR_开发者_如何学运维REFERENCES_4" minus "L00000000002$pb"
{standard input}:116:symbol: "L_OBJC_SELECTOR_REFERENCES_4" can't be undefined in a subtraction expression
{standard input}:110:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_5" minus "L00000000002$pb"
{standard input}:110:symbol: "L_OBJC_SELECTOR_REFERENCES_5" can't be undefined in a subtraction expression
{standard input}:80:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_2" minus "L00000000001$pb"
{standard input}:80:symbol: "L_OBJC_SELECTOR_REFERENCES_2" can't be undefined in a subtraction expression
{standard input}:74:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_3" minus "L00000000001$pb"
{standard input}:74:symbol: "L_OBJC_SELECTOR_REFERENCES_3" can't be undefined in a subtraction expression
{standard input}:67:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_1" minus "L00000000001$pb"
{standard input}:67:symbol: "L_OBJC_SELECTOR_REFERENCES_1" can't be undefined in a subtraction expression
{standard input}:64:non-relocatable subtraction expression, "L_OBJC_CLASS_REFERENCES_0" minus "L00000000001$pb"
{standard input}:64:symbol: "L_OBJC_CLASS_REFERENCES_0" can't be undefined in a subtraction expression
{standard input}:58:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_0" minus "L00000000001$pb"
{standard input}:58:symbol: "L_OBJC_SELECTOR_REFERENCES_0" can't be undefined in a subtraction expression
{standard input}:54:non-relocatable subtraction expression, "L_OBJC_CLASS_FlipsideViewController" minus "L00000000001$pb"
{standard input}:54:symbol: "L_OBJC_CLASS_FlipsideViewController" can't be undefined in a subtraction expression
{standard input}:unknown:Undefined local symbol L_OBJC_CLASS_FlipsideViewController
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_0
{standard input}:unknown:Undefined local symbol L_OBJC_CLASS_REFERENCES_0
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_1
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_3
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_2
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_5
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_4
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_6
{standard input}:unknown:Undefined local symbol L_OBJC_CLASS_REFERENCES_1
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_7
{standard input}:unknown:Undefined local symbol L_OBJC_CLASS_REFERENCES_2
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_8
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_9
after turning the compiler to clang(llvc)
I got this Internal Compiler error : segmentation fault
-(IBAction)clickedOpenMovie:(void)sender
{
NSString *myString = [NSString stringWithFormat:@"http://localhost:1935/mystream/mystream.sdp"];
NSURL *myURL = [NSURL URLWithString:myString];
[self playMovieAtURL:myURL];
}
-(IBAction)clickedOpenMovie:(void)sender
That's wrong. void
means no type, and you cannot pass an argument of no type to a function. That's probably what's getting you the error from cc1obj.
The correct signature for an action method is:
-(IBAction)clickedOpenMovie:(id)sender
id
is the type of any Objective-C object.
NSString *myString = [NSString stringWithFormat:@"http://localhost:1935/mystream/mystream.sdp"];
This is both wrong, because that is not a format string, and pointless, because you already have the finished string there. Cut out the message and just assign the string directly to the variable:
NSString *myString = @"http://localhost:1935/mystream/mystream.sdp";
You should only use stringWithFormat:
when you have a format string and some values you want spliced into it.
For anyone else getting the entirely non-helpful error message: "type '({anonymous})' does not have a known size", it's because you've screwed up one of your method prototypes. So, in the above case, the error is caused by the nonsense (void) argument. All the other errors are a linking fault not related to the first error. So, check you haven't fat-fingered an (id) type into something else.
So the problem was that I didn't add the framework to my xcode project, and the linked libraries were thusly not there.
精彩评论