This is an old revision of the document!
If you are getting unexplainable build errors on your own system when you run 'make default' after already running 'make clean', it can be one of two things.
Firstly, it can be because your using the wrong version of gcc, the sll2 project files can only compile with version 9 of gcc. You can use the same version of gcc as lab46 by using the following commands (assuming you are using a Raspberry Pi with it's default OS) in this link: https://gist.github.com/sol-prog/95e4e7e3674ac819179acf33172de8a9
If that does not fix the problem then you need to edit one of the Makefiles in the sll2 project directory. The offending Makefile is in the /src/list/ directory. Run the following command to edit that file:
USER@SYSTEM:$ nano ~/src/SEMESTER/DESIG/sll2/src/list/Makefile
remove the following line of code (after the line that says lib:
)
@date +'%Y%m%d%H%M%S' >> /var/public/$(SEMESTER)/$(DESIG)/$(PROJ)/.updates/.metrics/${USER}
Then try building the project again.
This week we will finish up the core functions by adding obtain to our list library. The three core functions are insert, append, and obtain.
This week you will find five new .c
files, each containing their corresponding functions.
We have 5 tasks to do for full credit. These are:
You also have an extra task, for extra credit, inside app/list/ of your sll2 base directory. The extra credit task is to build a linked list based on input from the user. You will also determine whether or not this linked list is a palindrome linked list or not. In case you don't know what a palindrome list is, here is an example. A palindrome list is a list that would look the same if you reversed it. For example, if you have a list, 1 2 3 2 1, that would be a palindrome, because if you display it backwards or forwards, it would display the same thing.
*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.
*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash
Recommended Order to make functions:
1. Obtain()
2. clearlist()
3. rmlist()
4. swap()
5. sort()
Details as to the behaviour of the functions can be found as comments inside the .c files of the programs themselves, located in src/list. If confusion arises in the make check process to verify then the .c code of the verify files can be found inside the unit/list directory. Do note that the verify code can rely upon some of the functions you are making to check the others, hence the recommended order.
Make sure to not overestimate what you are trying to do, especially in obtain(), do not try to optimize your program by removing the node, because the node will be held in the double pointer thatNode.