LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-02-2003, 01:22 PM   #1
javadi82
LQ Newbie
 
Registered: Oct 2003
Posts: 2

Rep: Reputation: 0
problems with lilo.conf and compiling c programs


Distrubtion :Mandrake 8.1

First question:
I have edited my lilo.conf so that Linux boots after 10 seconds. Yet, Linux does not boot automatically after 10 seconds and I have to type in linux to boot it.

Compiling C programs:
Wrote a Hello World "C" program and tried compiling it with:
gcc hello.c
Then typed in a.out. But I just cannot see any output. Do I have to set any variables to see the output.

Here's the C program:

#include <stdio.h>
int main(){
printf("Hello World");
}

Thanks
 
Old 11-02-2003, 01:43 PM   #2
musrum
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 112

Rep: Reputation: 15
1. lilo - you probably have a prompt line but no timeout line in your /etc/lilo.conf file. Add a line at the top of the file:

timeout = nnn

Where nnn is the number of 10ths of a second lilo should wait for automatically booting, i.e.

timeout = 300

would wait for 30 seconds. The other option is to remove the prompt line.

As for the C program. If your PATH environment variable does not contain the current directory or ., then programs in your current directory won't be found. Try './a.out' instead, or add . to your path, as in:

export PATH=.:$PATH
 
Old 11-02-2003, 02:05 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,753

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
Do you have a default line in your lilo.conf?

default=linux

Are there any errors when you attempt to execute the program, like command not found? I assume it compiles without errors?
 
Old 11-02-2003, 03:16 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,533

Rep: Reputation: 148Reputation: 148
Code:
printf("Hello World\n");
Try to modify the line this way. Without \n, the text goes to the buffer, \n forces it to be printed. Program exit should do the same, but different things happen...

The command to run the program after you compile it is
./a.out
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems compiling sigc++ programs siminone Programming 4 10-24-2004 06:31 PM
Problems with RedHat 9 LILO.conf Rudyzplace Linux - Software 0 08-31-2004 02:02 PM
lilo.conf and lilo.conf.anaconda difference blackzone Linux - General 1 07-06-2004 03:15 AM
Have anyone experimented problems compiling programs in rh9? mkaman Red Hat 2 10-31-2003 10:41 AM
lilo.conf and grub.conf no read access shanenin Linux - Software 1 10-02-2003 03:53 PM


All times are GMT -5. The time now is 11:56 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration