用于 Xcode 4.x 的 CS106B 库

2023-12-19

是否有 CS106B 的斯坦福 C++ 库版本可与 Xcode 4.x 一起使用。 iTunes U 视频已有大约 4 年历史,讲义中提到的库与 Xcode 4.x @ 10.7.3 不兼容。

我已经尝试安装 Xcode 3,但它在启动时崩溃,因此这不是一个选项。

也许有一些等效的库提供类似的功能?

有什么建议么?

讲座和材料可在此处获取:http://itunes.apple.com/de/course/programming-abstractions/id495054099 http://itunes.apple.com/de/course/programming-abstractions/id495054099

库可以在这里找到:http://see.stanford.edu/materials/icspacs106b/CS106Libs_for_Xcode.zip http://see.stanford.edu/materials/icspacs106b/CS106Libs_for_Xcode.zip

#include "genlib.h"
#include "simpio.h"
#include <iostream>


int main(int argc, const char * argv[])
{
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}

编译错误:

Ld /Users/user123/Library/Developer/Xcode/DerivedData/helloworld-ahlmhegbtmaasucxmbtekzjtbuha/Build/Products/Debug/helloworld normal i386
    cd "/Users/user123/Dropbox/$workspaces/Xcode/CS106B/helloworld"
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/user123/Library/Developer/Xcode/DerivedData/helloworld-ahlmhegbtmaasucxmbtekzjtbuha/Build/Products/Debug "-L/Users/user123/Dropbox/$workspaces/Xcode/CS106B/helloworld/cs106" "-L/Users/user123/Dropbox/$workspaces/Xcode/CS106B/helloworld/StanfordCPPLib" "-L/Users/user123/Dropbox/$workspaces/Xcode/CS106B/helloworld/helloworld/cs106" -F/Users/user123/Library/Developer/Xcode/DerivedData/helloworld-ahlmhegbtmaasucxmbtekzjtbuha/Build/Products/Debug -filelist /Users/user123/Library/Developer/Xcode/DerivedData/helloworld-ahlmhegbtmaasucxmbtekzjtbuha/Build/Intermediates/helloworld.build/Debug/helloworld.build/Objects-normal/i386/helloworld.LinkFileList -mmacosx-version-min=10.7 -lcs106 -o /Users/user123/Library/Developer/Xcode/DerivedData/helloworld-ahlmhegbtmaasucxmbtekzjtbuha/Build/Products/Debug/helloworld

Undefined symbols for architecture i386:
  "___CFConstantStringClassReference", referenced from:
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      CFString in libcs106.a(mainwrapper.o)
      ...
  "_NSApp", referenced from:
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      TerminateApp() in libcs106.a(mainwrapper.o)
      +[NSBundleWithoutSpuriousErrorLog aloadNibNamed:owner:] in libcs106.a(mainwrapper.o)
      _main in libcs106.a(mainwrapper.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      TerminateApp() in libcs106.a(mainwrapper.o)
      +[NSBundleWithoutSpuriousErrorLog aloadNibNamed:owner:] in libcs106.a(mainwrapper.o)
      _main in libcs106.a(mainwrapper.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
  "_objc_msgSendSuper", referenced from:
      +[NSBundleWithoutSpuriousErrorLog aloadNibNamed:owner:] in libcs106.a(mainwrapper.o)
      -[ConsoleTextView initWithFrame:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView dealloc] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView rangeForUserTextChange] in libcs106.a(ConsoleTextView.o)
  "_CFBundleGetInfoDictionary", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "_CFBundleCopyBundleURL", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "_objc_msgSend", referenced from:
      +[Glue applicationDidFinishLaunching:] in libcs106.a(mainwrapper.o)
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      CocoaConsoleResize(int, int, int, int) in libcs106.a(mainwrapper.o)
      TerminateApp() in libcs106.a(mainwrapper.o)
      SetConsoleSize(int, int, int, bool) in libcs106.a(mainwrapper.o)
      patched_read(void*, char*, int) in libcs106.a(mainwrapper.o)
      CreateMenuWithItems(NSString*, menuitem*, int) in libcs106.a(mainwrapper.o)
      ...
  "_CFURLCreateCopyDeletingLastPathComponent", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "_CFBundleGetMainBundle", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "Main()", referenced from:
      +[Glue studentMain] in libcs106.a(mainwrapper.o)
  "_CFRelease", referenced from:
      _main in libcs106.a(mainwrapper.o)
  "_NSFileHandleDataAvailableNotification", referenced from:
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
  "_NSForegroundColorAttributeName", referenced from:
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
  "_NSFontAttributeName", referenced from:
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
  "_NSBeep", referenced from:
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
  "_objc_msgSend_fpret", referenced from:
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
  "_objc_msgSend_stret", referenced from:
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView createConsoleInWindow] in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSThread", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSAutoreleasePool", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSDictionary", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSString", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSMenu", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSMenuItem", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSBundle", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
      .objc_class_name_NSBundleWithoutSpuriousErrorLog in libcs106.a(mainwrapper.o)
     (maybe you meant: .objc_class_name_NSBundleWithoutSpuriousErrorLog)
  ".objc_class_name_NSApplication", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSObject", referenced from:
      .objc_class_name_Glue in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSAttributedString", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSMutableDictionary", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSFont", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSScroller", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSScreen", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSWindow", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSScrollView", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSColor", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSNotificationCenter", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSFileHandle", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSData", referenced from:
      pointer-to-literal-objc-class-name in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSTextView", referenced from:
      .objc_class_name_ConsoleTextView in libcs106.a(ConsoleTextView.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我有同样的问题。解决这个问题的方法不是下载旧的 XCode(会崩溃)或更新版本的斯坦福图书馆(这是不存在的)——首选的方法是使用新的作业文件(每个文件都带有附加的必需库文件)并通过打开每个文件夹中的 xcode 项目文件直接在 XCode 4 中打开它们。您可以在当前课程网站中找到这些文件:http://www.stanford.edu/class/cs106b/ http://www.stanford.edu/class/cs106b/

不幸的是,您无法直接获取这种格式的旧作业文件。鉴于此,您可以 1) 遵循当前课程网站上的新练习,或者 2) 使用空白项目文件夹并稍微调整以遵循旧作业。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

用于 Xcode 4.x 的 CS106B 库 的相关文章

  • 用 C++ 进行服装建模 [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我正在编写一些软件 最终会绘制一个人体框架 可以配置各种参数 并且计划是在假人身上放置某种衣服 我研究
  • 使用Physics.Raycast 和Physics2D.Raycast 检测对象上的点击

    我的场景中有一个空的游戏对象 带有 2D 组件盒碰撞器 我将脚本附加到该游戏对象 void OnMouseDown Debug Log clic 但是当我点击我的游戏对象时 没有任何效果 你有什么想法 如何检测我的盒子碰撞器上的点击 使用光
  • Unix网络编程澄清

    我正在翻阅这本经典书籍Unix网络编程 https rads stackoverflow com amzn click com 0139498761 当我偶然发现这个程序时 第 6 8 节 第 179 180 页 include unp h
  • 为 Visual Studio 2013 编译 Tesseract

    我正在尝试使用tesseract在 Visual Studio 2013 中 我在链接器 gt 输入 不是 libtesseract302 static lib 中使用 libtesseract302 lib 一切都正常 并且已编译并运行
  • 如何为 C 分配的 numpy 数组注册析构函数?

    我想在 C C 中为 numpy 数组分配数字 并将它们作为 numpy 数组传递给 python 我可以做的PyArray SimpleNewFromData http docs scipy org doc numpy reference
  • XamlReader.Load 在后台线程中。是否可以?

    WPF 应用程序具有从单独的文件加载用户控件的操作 使用XamlReader Load method StreamReader mysr new StreamReader pathToFile DependencyObject rootOb
  • 单元测试一起运行时失败,单独运行时通过

    所以我的单元测试遇到了一些问题 我不能只是将它们复制并粘贴到这里 但我会尽力而为 问题似乎是 如果我一项一项地运行测试 一切都会按预期进行 但如果我告诉它一起运行测试 则 1 5 将通过 TestMethod public void Obj
  • 读取文件特定行号的有效方法。 (奖励:Python 手册印刷错误)

    我有一个 100 GB 的文本文件 它是来自数据库的 BCP 转储 当我尝试导入它时BULK INSERT 我在第 219506324 行上收到一个神秘错误 在解决此问题之前 我想看看这一行 但可惜的是我最喜欢的方法 import line
  • 无法在 Windows 运行时组件库的 UserControl 中创建依赖项属性

    我想在用户控件内创建数据可绑定属性 这个用户控件包含一个 Windows 运行时组件 项目 我使用下面的代码来创建属性 public MyItem CurrentItem get return MyItem GetValue Current
  • 将 Excel 导入到 Datagridview

    我使用此代码打开 Excel 文件并将其保存在 DataGridView 中 string name Items string constr Provider Microsoft Jet OLEDB 4 0 Data Source Dial
  • 未定义的行为或误报

    我 基本上 在野外遇到过以下情况 x x 5 显然 它可以在早期版本的 gcc 下编译干净 在 gcc 4 5 1 下生成警告 据我所知 警告是由 Wsequence point 生成的 所以我的问题是 这是否违反了标准中关于在序列点之间操
  • 未经许可更改内存值

    我有一个二维数组 当我第一次打印数组的数据时 日期打印正确 但其他时候 array last i 的数据从 i 0 到 last 1 显然是一个逻辑错误 但我不明白原因 因为我复制并粘贴了 for 语句 那么 C 更改数据吗 I use g
  • 批量更新 SQL Server C#

    我有一个 270k 行的数据库 带有主键mid和一个名为value 我有一个包含中值和值的文本文件 现在我想更新表格 以便将每个值分配给正确的中间值 我当前的方法是从 C 读取文本文件 并为我读取的每一行更新表中的一行 必须有更快的方法来做
  • Visual Studio 中的测试单独成功,但一组失败

    当我在 Visual Studio 中单独运行测试时 它们都顺利通过 然而 当我同时运行所有这些时 有些通过 有些失败 我尝试在每个测试方法之间暂停 1 秒 但没有成功 有任何想法吗 在此先感谢您的帮助 你们可能有一些共享数据 检查正在使用
  • 将 log4net 与 Autofac 结合使用

    我正在尝试将 log4net 与 Autofac 一起使用 我粘贴了这段代码http autofac readthedocs org en latest examples log4net html http autofac readthed
  • 如何编写一个同时需要请求和响应Dtos的ServiceStack插件

    我需要提供本地化数据服务 所有本地化的响应 Dto 都共享相同的属性 IE 我定义了一个接口 ILocalizedDto 来标记那些 Dto 在请求端 有一个ILocalizedRequest对于需要本地化的请求 Using IPlugin
  • 如何对 Web Api 操作进行后调用?

    我创建了一个 Web API 操作 如下所示 HttpPost public void Load string siteName string providerName UserDetails userDetails implementat
  • 如何在 C# 中调整图像大小同时保持高质量?

    我从这里找到了一篇关于图像处理的文章 http www switchonthecode com tutorials csharp tutorial image editing saving cropping and resizing htt
  • 线程和 fork()。我该如何处理呢? [复制]

    这个问题在这里已经有答案了 可能的重复 多线程程序中的fork https stackoverflow com questions 1235516 fork in multi threaded program 如果我有一个使用 fork 的
  • 使用 GROUP 和 SUM 的 LINQ 查询

    请帮助我了解如何使用带有 GROUP 和 SUM 的 LINQ 进行查询 Query the database IEnumerable

随机推荐