473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Main function not defined

I just downloaded the LCC-Win Compiler and wrote the following program:

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

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

And I get 'Function main is not defined.' Would anyone have an idea as to
why?

Nov 14 '05 #1
4 5240
"MattFit" <ms*********@comcast.net> writes:
I just downloaded the LCC-Win Compiler and wrote the following program:

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

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

And I get 'Function main is not defined.' Would anyone have an idea as to
why?


comp.compilers.lcc would be a better place for that question. The
program looks ok (and the "#include <stdlib.h>" isn't necessary).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #2

"MattFit" <ms*********@comcast.net> wrote in message
news:04******************************@localhost.ta lkaboutprogramming.com...
I just downloaded the LCC-Win Compiler and wrote the following program:

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

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

And I get 'Function main is not defined.' Would anyone have an idea as to
why?

I know nothing about LCC but what youve told me. You said "win" compiler
correct? That means it is looking for winmain not main. Look into the
documentation.
Nov 14 '05 #3
"DHOLLINGSWORTH2" <DH*************@cox.net> writes:
"MattFit" <ms*********@comcast.net> wrote in message
news:04******************************@localhost.ta lkaboutprogramming.com...
I just downloaded the LCC-Win Compiler and wrote the following program:

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

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

And I get 'Function main is not defined.' Would anyone have an idea as to
why?

I know nothing about LCC but what youve told me. You said "win" compiler
correct? That means it is looking for winmain not main. Look into the
documentation.


No, lcc-win32 should be able to handle the above program. If it were
looking for "winmain", it wouldn't print an error messages saying it
can't find "main". As I wrote earlier, comp.compilers.lcc is the
place for this question. It's probably a configuration problem.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #4
MattFit wrote on 26/02/05 :
I just downloaded the LCC-Win Compiler and wrote the following program:

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

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

And I get 'Function main is not defined.' Would anyone have an idea as to
why?


That's a job for Jacob.

Hello Jacob, where are you ?

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"Clearly your code does not meet the original spec."
"You are sentenced to 30 lashes with a wet noodle."
-- Jerry Coffin in a.l.c.c++

Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

192
by: Kwan Ting | last post by:
The_Sage, I see you've gotten yourself a twin asking for program in comp.lang.c++ . http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=45cd1b289c71c33c&rnum=1 If you the oh so mighty...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
19
by: Steven T. Hatton | last post by:
The short sample program listed below has some features that I find to be bad style. In particular, they fail to communicate the connection between names used in this program and the location in...
12
by: Bill Cunningham | last post by:
> #include <stdlib.h> > #include <stdio.h> > > int main(int argc, char *argv) { > FILE *in, *out; > > if(argc==1) > { > in = stdin; > out = stdout;
12
by: onkar | last post by:
sometimes main accepts int main() and sometimes int main(int argc,char** argv) and sometimes int main(int argc,char **argv,char** env) still the code complies properly How is this possible ???...
8
by: Michal Nazarewicz | last post by:
Hi, What does returning 0 from main() mean according to C89/C90 standard? I've found that in C99 it means successful termination (7.20.4.3p5) however as I'm editing book on C at Polish Wikibooks...
4
by: urkel | last post by:
Hello everybody, I am getting bogged-down by these errors troubling me for the last few days I am writing a C program with a main and several user-defined functions. One of the user-defined...
28
by: ravi | last post by:
Hello everybody, I am writing a small application which does some work before the user main function starts execution. I am trying to #define the main function. But the problem is that,
27
by: junky_fellow | last post by:
Guys, Can I return 0, from main() ? Is this equivalent to exit(EXIT_SUCCESS) ? thanks for any help...
11
by: aarklon | last post by:
Hi all, I have heard many discussions among my colleagues that main is a user defined function or not. arguments in favour:- 1) if it is built in function it must be defined in some header...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.