是否有 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)