i have 3 C++ source files and i need to call a function from one file into another
getch.cpp
#include<stdio.h>
#include "getch2.h"
main()
{
char ch='x';
fun(ch);
}
getch2.cpp
#include<stdio.h>
void fun(char);
main()
{
}
void fun(char x)
{
printf("the ascii value of the char is %d",x);
}
func.h
void fun(char);
when i compile getch2.cpp i get the error
C:\Users\amolsi\AppData\Local\Temp\cc1k7Vdp.o getch.cpp:(.text+0x18): undefined reference to `fun(char)'
C:\Users\amolsi\Documents\C files\collect2.exe [Error] ld returned 1 exit status