#include <stdio.h>
#include <cs50.h>
int animalCategory(void); //function prototype
int currencyCategory(void); //function prototype
int scienceCategory(void); // function prototype
int main()
{
int Main_menu = 0;
{
printf("\n\tTrivia Game\n");
printf("1.\tAnimal question\n");
printf("2.\tCurrency question\n");
printf("3.\tScience question\n");
printf("4.\tQuit\n");
scanf("%d", &Main_menu);
switch(Main_menu)
{
case 1:
if (animalCategory() == 1)
printf("\ncorrect!\n");
else
{
printf("\nIncorrect\n");
printf("The correct answer is Reindeer!\n");
}
break;
case 2:
if (currencyCategory() == 2)
printf("\nCorrect!\n");
else
{
printf("\nIncorrect!\n");
printf("The correct answer is Ecuador\n");
}
break;
case 3:
if (scienceCategory() == 3)
printf("\nCorrect!\n");
else
{
printf("\nIncorrect!\n");
printf("The correct answer is 4\n");
}
break;
case 4:
return 0;
}
//function definition
int animalCategory();
{
int iAnswer = 0;
system("clear");
printf("\tAnimal Category\n");
printf("\tWhat is the only kind of deer whose females have antlers?\n");
printf("1.\tReindeer\n");
printf("2.\tPringdeer\n");
printf("3.\tUggdeer\n");
scanf("%d", &iAnswer);
return iAnswer;
}
//function definition
int currencyCategory();
{
int iAnswer = 0;
system("clear");
printf("\n\tCurrency Category\n");
printf("\tU.S dollar is the official currency of which latin American Nation?\n");
printf("1.\tColombia\n");
printf("2.\tEcuador\n");
printf("3.\tArgentina\n");
scanf("%d", &iAnswer);
return iAnswer;
}
//function definition
int scienceCategory();
{
int iAnswer = 0;
system("clear");
printf("\n\tScience Category\n");
printf("How many planets in our solar system are smaller than the Earth?\n");
printf("1.\t5\n");
printf("2.\t6\n");
printf("3.\t4\n");
scanf("%d", &iAnswer);
return iAnswer;
}
}
}
the compiler still keeps printing the following error
/home/ubuntu/workspace/fooling/ $ make trivia
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow trivia.c -lcs50 -lm -o trivia
/tmp/trivia-0acc92.o: In function `main':
/home/ubuntu/workspace/fooling/trivia.c:24: undefined reference to `AnimalCategory'
/home/ubuntu/workspace/fooling/trivia.c:36: undefined reference to `CurrencyCategory'
/home/ubuntu/workspace/fooling/trivia.c:47: undefined reference to `ScienceCategory'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [trivia] Error 1