<br><br>
<div class="gmail_quote">2009/2/4 Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">2009/2/4 ankit jain <<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>>:<br>><br></div>
<div class="Ih2E3d">> The CMakeLists iam using contains:<br>><br>> PROJECT(hello)<br>><br>> ADD_EXECUTABLE(hello h1.C)<br>><br>> Error iam getting is:<br>><br>> Linking CXX executable hello<br>
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18): In<br>> function `_start':<br>> : undefined reference to `main'<br><br></div>This is not a CMake error this is a C++ error<br>your source file is lacking the main() function thus<br>
the compiler cannot produce an executable.<br><br>I bet that if you search for " undefined reference to `main' " on the Web<br>you'll find the answer to such question.<br><font color="#888888"><br>--<br>
Erk<br></font></blockquote></div>
<div><br>But if i replace ADD_EXECUTABLE by ADD_LIBRARY there is no error and a library get successfully built.</div>
<div> </div>
<div> </div>
<div>AJ</div>