"[Linker error] undefined reference to 'function()'

#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>

int themenu();
int boygroups();
int girlgroups();
int solo();
int sub();



int main(void)
{
themenu();
return 0;
}

int themenu()
{
int pili,sagot,ans,kunin=0,yes,tuloy;
printf("\n\n\n\n\n\t\tTHIS MENU IS ALL ABOUT KPOP\n");
printf("\n\t\t\t\t1. Boy Groups\n");
printf("\t\t\t\t2. Girl Groups\n");
printf("\t\t\t\t3. Solo Performer\
printf("\t\t\t\t4. Sub-groups\n");
printf("\t\t\t\t5. I want to exit now\n");
printf("\n\t\t\tChoose the number you want: ");
scanf("%d",&pili);
switch (pili)
{
case 1:
printf("\n\n\n\t\t\t\t1. %s\n",unang[0].numberone);
printf("\t\t\t\t2. %s\n",unang[0].numbertwo);
printf("\t\t\t\t3. %s\n",unang[0].numberthree);
printf("\t\t\t\t4. %s\n",unang[0].numberfour);
break;
case 2:
printf("\n\n\n\t\t\t\t1. %s\n",unang[1].numberone);
printf("\t\t\t\t2. %s\n",unang[1].numbertwo);
printf("\t\t\t\t3. %s\n",unang[1].numberthree);
printf("\t\t\t\t4. %s\n",unang[1].numberfour);
break;
case 3:
printf("\n\n\n\t\t\t\t1. %s\n",unang[2].numberone);
printf("\t\t\t\t2. %s\n",unang[2].numbertwo);
printf("\t\t\t\t3. %s\n",unang[2].numberthree);
printf("\t\t\t\t4. %s\n",unang[2].numberfour);
break;
case 4:
printf("\n\n\n\t\t\t\t1. %s\n",unang[3].numberone);
printf("\t\t\t\t2. %s\n",unang[3].numbertwo);
printf("\t\t\t\t3. %s\n",unang[3].numberthree);
printf("\t\t\t\t4. %s\n",unang[3].numberfour);
break;

}

printf("\n\t\t\tChoose the number you want: ");
scanf("%d",&ans);



kunin=pili;

if(kunin==1)
int boygroups();


else if(kunin==2)
int girlgroups();

else if(kunin==3)
int solo();

else if(kunin==4)
int sub();


return 0;
getch();

}


int boygroups(int ans) {
switch (ans) {
case 1: printf("\n\n\n\t\t\t\t1. %s\n",songs[0].una);
printf("\t\t\t\t2. %s\n",songs[0].pangalawa);
printf("\t\t\t\t3. %s\n",songs[0].pangatlo);
printf("\t\t\t\t4. %s\n",songs[0].pangapat);
break;
case 2: printf("\n\n\n\t\t\t\t1. %s\n",songs[1].una);
printf("\t\t\t\t2. %s\n",songs[1].pangalawa);
printf("\t\t\t\t3. %s\n",songs[1].pangatlo);
printf("\t\t\t\t4. %s\n",songs[1].pangapat);
break;
case 3: printf("\n\n\n\t\t\t\t1. %s\n",songs[2].una);
printf("\t\t\t\t2. %s\n",songs[2].pangalawa);
printf("\t\t\t\t3. %s\n",songs[2].pangatlo);
printf("\t\t\t\t4. %s\n",songs[2].pangapat);
break;
case 4: printf("\n\n\n\t\t\t\t1. %s\n",songs[3].una);
printf("\t\t\t\t2. %s\n",songs[3].pangalawa);
printf("\t\t\t\t3. %s\n",songs[3].pangatlo);
printf("\t\t\t\t4. %s\n",songs[3].pangapat);
break;
default: return themenu();
}
}

int girlgroups(int ans) {
switch (ans) {
case 1: printf("\n\n\n\t\t\t\t1. %s\n",songs[4].una);
printf("\t\t\t\t2. %s\n",songs[4].pangalawa);
printf("\t\t\t\t3. %s\n",songs[4].pangatlo);
printf("\t\t\t\t4. %s\n",songs[4].pangapat);

break;
case 2: printf("\n\n\n\t\t\t\t1. %s\n",songs[5].una);
printf("\t\t\t\t2. %s\n",songs[5].pangalawa);
printf("\t\t\t\t3. %s\n",songs[5].pangatlo);
printf("\t\t\t\t4. %s\n",songs[5].pangapat);
break;
case 3: printf("\n\n\n\t\t\t\t1. %s\n",songs[6].una);
printf("\t\t\t\t2. %s\n",songs[6].pangalawa);
printf("\t\t\t\t3. %s\n",songs[6].pangatlo);
printf("\t\t\t\t4. %s\n",songs[6].pangapat);
break;
case 4: printf("\n\n\n\t\t\t\t1. %s\n",songs[7].una);
printf("\t\t\t\t2. %s\n",songs[7].pangalawa);
printf("\t\t\t\t3. %s\n",songs[7].pangatlo);
printf("\t\t\t\t4. %s\n",songs[7].pangapat);
break;
} }


int solo(int ans) {
switch (ans) {
case 1: printf("\n\n\n\t\t\t\t1. %s\n",songs[8].una);
printf("\t\t\t\t2. %s\n",songs[8].pangalawa);
printf("\t\t\t\t3. %s\n",songs[8].pangatlo);
printf("\t\t\t\t4. %s\n",songs[8].pangapat);
break;
case 2: printf("\n\n\n\t\t\t\t1. %s\n",songs[9].una);
printf("\t\t\t\t2. %s\n",songs[9].pangalawa);
printf("\t\t\t\t3. %s\n",songs[9].pangatlo);
printf("\t\t\t\t4. %s\n",songs[9].pangapat);
break;
case 3: printf("\n\n\n\t\t\t\t1. %s\n",songs[10].una);
printf("\t\t\t\t2. %s\n",songs[10].pangalawa);
printf("\t\t\t\t3. %s\n",songs[10].pangatlo);
printf("\t\t\t\t4. %s\n",songs[10].pangapat);
break;
case 4: printf("\n\n\n\t\t\t\t1. %s\n",songs[11].una);
printf("\t\t\t\t2. %s\n",songs[11].pangalawa);
printf("\t\t\t\t3. %s\n",songs[11].pangatlo);
printf("\t\t\t\t4. %s\n",songs[11].pangapat);
break;
} }


int sub(int ans) {
switch (ans) {
case 1: printf("\n\n\n\t\t\t\t1. %s\n",songs[12].una);
printf("\t\t\t\t2. %s\n",songs[12].pangalawa);
printf("\t\t\t\t3. %s\n",songs[12].pangatlo);
printf("\t\t\t\t4. %s\n",songs[12].pangapat);
break;
case 2: printf("\n\n\n\t\t\t\t1. %s\n",songs[13].una);
printf("\t\t\t\t2. %s\n",songs[13].pangalawa);
printf("\t\t\t\t3. %s\n",songs[13].pangatlo);
printf("\t\t\t\t4. %s\n",songs[13].pangapat);
break;
case 3: printf("\n\n\n\t\t\t\t1. %s\n",songs[14].una);
printf("\t\t\t\t2. %s\n",songs[14].pangalawa);
printf("\t\t\t\t3. %s\n",songs[14].pangatlo);
printf("\t\t\t\t4. %s\n",songs[14].pangapat);
break;
case 4: printf("\n\n\n\t\t\t\t1. %s\n",songs[15].una);
printf("\t\t\t\t2. %s\n",songs[15].pangalawa);
printf("\t\t\t\t3. %s\n",songs[15].pangatlo);
printf("\t\t\t\t4. %s\n",songs[15].pangapat);
break;
} }


this is my code, when I tried to run it, the compiler will always say about Linker error thing, i tried removing the int before declaring functions but it will say the same error again, what do you think is my mistake here?
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2) Your linker will be telling you exactly which symbols are undefined. I'm sure you have a good reason for deciding to withhold that information from us, but I'm struggling to work out what that reason might be.

3) I notice that your function declarations,e.g. :

int solo();

don't match the function definitions, e.g. :

int solo(int ans) {
what do you think i'll write to make it match, and sorry for not following rules, it's my first time asking question here.
what do you think i'll write to make it match

Surely you can see the obvious difference between your declaration and your definition?
i can't i tried so many ways how to do it but i just can't. please help me.
So the following two lines look exactly the same to you?

int solo()

int solo(int ans)
no. i tried erasing 'int ans' on the other one, and also tried putting 'int ans' on the other one, but i still get an error?
As you could have found out from any textbook or tutorial - in less time than you've spent posting here - your declaration needs to show the types of the arguments to the function. If you're still getting errors after that, then there's another problem.

you need to post the actual error so we can see,

obviously its difficult to tell us what the problem is when you are a beginner, so its even more important to show us the actual error.
Topic archived. No new replies allowed.