ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi im just starting to learn programming and already have problems i wrote the hello program in KDelop and when i was done i opened the konsole at bottom and logged in as root and typed "cc hello.c" as far as i know it was supposed to make a exe file called a.out so i went back to kopnsole and typed "a.out" as root and it gave me
/usr/lib/gcc/i386-redhat-linux/4.0.1/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
not sure what that means but i looked over everything and its just as book has it i even indented the "printf" part.
that is program as written now here is the errors after "gcc -wall -o test hell.c"
Code:
[boxerboy@localhost ~]$ gcc -Wall -o test hello.c
hello.c:3: warning: return type defaults to ‘int’
hello.c: In function ‘main’:
hello.c:5: warning: control reaches end of non-void function
hello.c:5:2: warning: no newline at end of file
after trying devs version (pasted it in) i returned this:
Code:
[boxerboy@localhost ~]$ gcc -Wall -o test hello.c
/usr/lib/gcc/i386-redhat-linux/4.0.1/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
looks like same thing only now its minus one error.
Oh and you asked about programs... download install anjuta by
yum install anjuta
i installed it and it said it installed succesfully but i dont see it in the list under programming. is it called that or would it store it under different name?
boxerboy@localhost ~]$ gcc hello.c -o hello
/usr/lib/gcc/i386-redhat-linux/4.0.1/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.