I was about to submit pset3 and pset4 which I have completed, but in the process of keeping my house in order by checking every code before submission, I discovered that helpers.c has developed issues. When I make find I receive this information from the compiler:
clang -ggdb3 -O0 -std=c11 -Wall -Werror -o find find.c helpers.c -lcs50 -lm /tmp/find-b1555f.o: In function `main': /home/ubuntu/workspace/pset3/find/find.c:55: undefined reference to `sort' clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [find] Error 1
As a result, of course, it failed check50, which gave this advice:
helpers.c exists helpers.c compiles ! Fix the following dependencies first: helpers.c exists finds 42 in {42,43,44} ! Fix the following dependencies first: helpers.c compiles finds 42 in {41,42,43} ! Fix the following dependencies first: helpers.c compiles finds 42 in {40,41,42} ! Fix the following dependencies first: helpers.c compiles finds 42 in {41,42,43,44} ! Fix the following dependencies first: helpers.c compiles finds 42 in {40,41,42,43} ! Fix the following dependencies first: helpers.c compiles finds 42 in {39,40,41,42} ! Fix the following dependencies first: helpers.c compiles doesn't find 42 in {39,40,41}
Please, can someone be kind enough to advise me what to do. I have checked, all the files are intact. My only suspicion is the bubble sort code I wrote and cannot see why It should be complaining of it. Here, is a snipet of the code:
#include <stdio.h>
#include <cs50.h>
void BubbleSort(int values[], int n)
{
// TODO: implement an O(n^2) sorting algorithm
for (int i = values[n - 1]; i >= 0; i--)
{
for (int j = 0; j <= i; j++)
{
if (values[j - 1] > values[j])
{
int temp = values[j - 1];
values[j - 1] = values[j];
values[j] = temp;
}
}
}
return;
}