iPhone 链接器错误 (AudioStreamer)

发布于 2024-09-14 06:45:56 字数 999 浏览 7 评论 0原文

我正在使用 Matt Gallagher 的音频流项目。我下载了代码/项目,它运行/编译/链接得很好。

问题是当我尝试将 AudioStreamer 类集成到我自己的项目中时。我添加了所有必要的框架并检查了项目设置,以确保它们尽可能匹配 Matt 的项目。

我还没有添加 Matt 的任何代码(除了 AudioStreamer 类)。我现在所做的就是定义这个函数:

- (void)createStreamer {
    streamer = [[AudioStreamer alloc] initWithURL:audiourl];
}

如果我注释掉该函数中的唯一一行,则项目可以正常编译/链接。如果我把那一行留在那里,我会得到这个错误(如果我理解正确的话,这是一个链接器错误):

"_OBJC_CLASS_$_AudioStreamer", referenced from:
objc-class-ref-to-AudioStreamer in AudioViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

我用谷歌搜索了这个错误,大多数人得到它是因为他们忘记包含某个框架。我拥有项目中所需的所有框架。

有谁知道发生此错误的任何其他原因?是否有一些我可能忽略的设置?

大多数项目设置都是相同的,除了 Matt 项目中的构建架构设置为 arm6、arm7 和我的项目中的 i386 之外。我尝试编译模拟器和设备,但出现相同的错误。

我唯一能想到的是 Matt 的项目是 2009 年的(相当旧),所以也许新 xcode 中的默认配置发生了一些变化?

如果有人可以提供任何见解,我将不胜感激。

谢谢。

I'm using Matt Gallagher's Audio Streaming Project. I downloaded the code/project and it runs/compiles/links just fine.

The problem is when I try to integrate the AudioStreamer class into my own project. I added all the necessary frameworks and checked over the project settings to make sure they match Matt's project as much as possible.

I haven't added any of Matt's code yet (except for the AudioStreamer class). All I'm doing for now is defining this function:

- (void)createStreamer {
    streamer = [[AudioStreamer alloc] initWithURL:audiourl];
}

If I comment out the only line in that function the project compiles/links fine. If I leave that line there I get this error (which if I understand correctly is a linker error):

"_OBJC_CLASS_$_AudioStreamer", referenced from:
objc-class-ref-to-AudioStreamer in AudioViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I googled this error and most people get it because they forgot to include a certain framework. I have all the frameworks I need in my project.

Does anyone know any other reason why this error could occur? Is there some setting that I may be overlooking?

Most of the project settings are the same except for the build architecture being set to arm6,arm7 in Matt's project and i386 on mine. I tried compiling for both simulator and device and I get the same error.

The only thing I could think of is that Matt's project is dated 2009 (pretty old) so maybe something changed in the default configuration in the new xcodes?

If anyone can provide any insight I'd appreciate it.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉城凉梦凉人心 2024-09-21 06:45:56

听起来您需要将 AudioStreamer.m 添加到您的目标中。

It sounds like you need to add AudioStreamer.m to your target.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文