Hi -
1. To get rid of this warning, you should:
Quote:
warning: return type of ‘main’ is not ‘int’
|
Code:
int
main (int argc, char *argv[])
"int main" isn't absolutely necessary (it's just a warning) ... but I would argue it's very good practice. Honest!
2. Fixing this will cause a second warning. You should also change "exit (0)" to:
Again, it isn't necessary ... but "return 0;" from function "main ()" is simply better form than calling "exit ()".
3. Finally, your program uses CDE ... so you need to include the CDK library when you link your program. For example:
Quote:
gcc -g test.c -o test -lcdk -lncurses
|
In the above example, "-lcdk" specifies your CDK library. CDK, in turn, will probably need "-lncurses". You don't need "-c" (this example compiles and links in one step), you don't need "-o test.o" ("test.o" is the default object name; re-specifying it is just redundant). The "-g" allows you to run your program in a debugger - always a Good Idea.
'Hope that helps .. PSM