I am trying to compile a very simple program on UNIX, which consists of several files, each of them has a function that prints out a string of text.
Then the file with the main function call each of these functions.
Here are the codes in the files:
Expand|Select|Wrap|Line Numbers
- //****** hello.h
- void func_hello();
- //******hello.c
- #include <stdio.h>
- #include "hello.h"
- void func_hello()
- {
- printf("Hello, how are you?\n");
- }
- //****** myApp.c
- #include <stdio.h>
- #include "hello.h"
- void main()
- {
- func_hello();
- func_here();
- func_bye();
- }
Expand|Select|Wrap|Line Numbers
- % make -f myMakefile
- cc -o myApp hello.o here.o bye.o
- Undefined first referenced
- symbol in file
- main /vol/PACK/SunWorkshop/SUNWspro/SC4.2/lib /crt1.o
- ld: fatal: Symbol referencing errors. No output written to myApp
- *** Error code 1
- make: Fatal error: Command failed for target `myApp'
Can anyone please tell me what's wrong here??? Please!