0

嗯?

谷歌没有返回这个错误是什么......我所做的就是将一个movieplayercontroller添加到一个反面iphone应用程序中。

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

将编译器转为 clang(llvc) 后

我得到了这个内部编译器错误:分段错误

-(IBAction)clickedOpenMovie:(void)sender
{
    NSString *myString = [NSString stringWithFormat:@"http://localhost:1935/mystream/mystream.sdp"];

    NSURL *myURL = [NSURL URLWithString:myString];

   [self playMovieAtURL:myURL];

}
4

3 回答 3

1
-(IBAction)clickedOpenMovie:(void)sender

那是错误的。void表示没有类型,并且您不能将没有类型的参数传递给函数。这可能就是让你从 cc1obj 得到错误的原因。

动作方法的正确签名是:

-(IBAction)clickedOpenMovie:(id)sender

id是任何 Objective-C 对象的类型。

NSString *myString = [NSString stringWithFormat:@"http://localhost:1935/mystream/mystream.sdp"];

这既是错误的,因为那不是格式字符串,也是没有意义的,因为您已经在那里有了完成的字符串。剪下消息并将字符串直接分配给变量:

NSString *myString = @"http://localhost:1935/mystream/mystream.sdp";

只有stringWithFormat:当你有一个格式字符串和一些你想要拼接到其中的值时,你才应该使用它。

于 2010-04-17T21:13:34.757 回答
1

对于其他人得到完全没有帮助的错误消息:“类型'({anonymous})'没有已知的大小”,这是因为你搞砸了你的方法原型之一。因此,在上述情况下,错误是由废话 (void) 参数引起的。所有其他错误都是与第一个错误无关的链接错误。因此,请检查您是否没有将 (id) 类型添加到其他内容中。

于 2011-02-11T12:58:28.903 回答
0

所以问题是我没有将框架添加到我的 xcode 项目中,因此链接库不存在。

于 2010-04-17T20:04:41.170 回答