Assignments (Demo Day) The course included 7 assignments. I don't know how to build cpplib in this way, but others may be able to answer that. Stanford offers their own gentle onramp to collection classes and convenience utilities through the libStanfordCPPLib.a library which I leverage in my solutions. so file-rather than a static one, I suggest editing your question to add information about that. (If you need to build a shared library-i.e., an.
o files unless you prefer to do so or need to produce an especially small statically linked executable. o files linked into it, though, so you should not have to use the individual. The contents of Makefile, particularly under # Test program, show how to do this. a file (as one might usually do), it appears one way to use the library is to link against these. statically linkable object files in the obj subdirectory of cpplibīesides linking against the.a library file, lib/libStanfordCPPLib.a, which is probably what you will link into your programs configure step before running make the README clarifies that, to build this software, one simply runs make. Often to build software from source there is a. See the contents of the README file in the cpplib archive for additional information. This procedure worked for me, and the test executable ran successfully. # Retrieve, configure, build, and test the library. Sudo apt-get update & sudo apt-get install build-essential openjdk-7-jdk If you want to install The Stanford Portable Library for C++, you can do that by running these commands in a terminal ( Ctrl+ Alt+ T): # Install build dependencies and set up /usr/local/src for administrators. To use the library from C programs, link to libcs.a. Once you have successfully built and installed the library using those steps, two new files will exist in /usr/local/lib: libcs.a and spl.jar. That works on Fedora, but not Ubuntu, because Fedora's /bin/sh is provided by bash. In the build instructions, which as of the time of this writing have not been updated with a procedure for Ubuntu, Fedora users are instructed to run sudo make install. Makefile:320: recipe for target 'install' failed Running sudo make install instead of sudo make SHELL=/bin/bash install will produce the error: cp: cannot stat ‘build/lib/’: No such file or directory This file exports several useful string functions that are not included in the C++ string library. SHELL=/bin/bash is required, at least for the make install step, because the Makefile uses a feature present in bash ( brace expansion) but not present in Ubuntu's default /bin/sh (which is dash). This file exports a set of functions that simplify input/output operations in C++ and provide some error-checking on console input. # Retrieve, configure, build, test, and install the library. Sudo apt-get update & sudo apt-get install build-essential openjdk-7-jdk gitĬd /usr/local/src & sudo chgrp sudo. If you want to install the C-based CS50 fork of the Stanford Portable Library, you can install it by running these commands in a terminal ( Ctrl+ Alt+ T): # Install build dependencies and set up /usr/local/src for administrators.