Reputation: 432
is there a version of the Stanford C++ Libraries for CS106B available for use with Xcode 4.x. The iTunes U videos are about 4 years old and the libs referred to in the Handouts are not compatible with Xcode 4.x @ 10.7.3.
I've already tried to install Xcode 3 but it crashes on startup so this is not an option.
Maybe there are some equivalent libs out there which provide similar functionality?
Any suggestions?
lectures and materials are available here: http://itunes.apple.com/de/course/programming-abstractions/id495054099
libs are available here: 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;
}
compile errors:
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)
Upvotes: 2
Views: 4738
Reputation: 2341
I'm using latest available 106b assignments from here and libraries from here. These libraries are meant to be used with the book that is published in 2014 (you may also use it with book's source code). Then I compiled libraries (just cd to main dir and use make on command line) and use file lib/libStanfordCPPLib.a
instead of provided in assignments (I'm using OS X 10.11 and last assignment's version is 10.8). It seems to work.
Upvotes: 1
Reputation: 720
A new link for CS106B material for non-stanford students: http://www.stanford.edu/class/archive/cs/cs106b/cs106b.1136/
Upvotes: 3
Reputation: 13
The absolute easiest way to do this is to go to CS106B's website and download one of the assignments. From here you will have the headers from Stanford's library. It is nearly fruitless to continue and try and load these libraries into Xcode. This way is much easier.
http://www.stanford.edu/class/cs106b/ - link to Stanfords websites where you will find the assignments.
Upvotes: 1
Reputation: 46
I had the same problem. The way to solve this is not by downloading an older XCode (which will crash) or a newer version of the Stanford library (which is non-existent)-- the preferred way is to use the new assignment files (each of them come with the attached requisite library files) and open those directly in XCode 4 by opening the xcode project file in each of those folders. You can find these files in the current class website: http://www.stanford.edu/class/cs106b/
The unfortunate thing is that you cannot directly get the old assignment files in this format. Given that, you can either 1) Follow the new exercises on the current class website, or 2) Use the blank project folders and tweak slightly to follow the old assignment.
Upvotes: 3