<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hello every one I'm using Ubuntu 9.04 Linux.... I'm facing some problem while compiling my C program:::<br><br><meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
        <title></title>
        <meta name="GENERATOR" content="OpenOffice.org 3.0  (Linux)">
        <style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
        -->
        </style>

<p style="margin-bottom: 0cm; line-height: 100%;"><br>
</p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2"><b>#include&lt;stdio.h&gt;</b></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2"><b>#include&lt;stdlib.h&gt;</b></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2"><b>#include&lt;string.h&gt;</b></font></font></p>

<br><p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace"><b>int</b></font><font face="Courier New, monospace">
main (</font><font face="Courier New, monospace"><b>int</b></font><font face="Courier New, monospace">
argc,</font><font face="Courier New, monospace"><b>char</b></font><font face="Courier New, monospace">
*argv[])        /* Main function */</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2">{</font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace">        </font><font face="Courier New, monospace"><b>&nbsp;&nbsp;&nbsp; char</b></font><font face="Courier New, monospace">
cont;</font></font></font></p><p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace"><b>&nbsp;&nbsp;&nbsp; printf</b></font><font face="Courier New, monospace">("Want
to enter new text? y/n: ");</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace">        &nbsp;&nbsp;&nbsp; cont=</font><font face="Courier New, monospace"><b>getch();</b></font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace">        </font><font face="Courier New, monospace"><b>&nbsp;&nbsp;&nbsp; if</b></font><font face="Courier New, monospace">(cont=='y')</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2">        &nbsp;&nbsp;&nbsp; {</font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace">                </font><font face="Courier New, monospace"><b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf</b></font><font face="Courier New, monospace">("Enter
text for %s",argv[1]);</font></font></font></p>



<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2">                &nbsp;&nbsp;&nbsp; }</font></font></p><p style="margin-bottom: 0cm; line-height: 100%;"><font face="Consolas, monospace"><font style="font-size: 10pt;" size="2"><font face="Courier New, monospace"><b>&nbsp;&nbsp;&nbsp; return</b></font><font face="Courier New, monospace">
EXIT_SUCCESS;</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%;"><font face="Courier New, monospace"><font style="font-size: 10pt;" size="2">}</font></font></p><br>while compiling this code with the help of following command <br>$gcc -o q2 q2.c<br>it gives me the following error...<br><br>supravat@supravat-desktop:~/c/Done$ gcc -o q2 q2.c<br>/tmp/cc07EFXt.o: In function `main':<br>q2.c:(.text+0x42): undefined reference to `getch'<br>collect2: ld returned 1 exit status<br><br>This code runs successfully in Windows.... Please help me...<br><br>


        <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
        <title></title>
        <meta name="GENERATOR" content="OpenOffice.org 3.0  (Linux)">
        <style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
        --></style><br></div><br>
      <!--1--><hr size=1></hr> Love Cricket? Check out live scores, photos, video highlights and more. <a href="http://in.rd.yahoo.com/tagline_cricket_2/*http://cricket.yahoo.com" target="_blank"> Click here</a>.</body></html>