Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Newbie question

First of all, this _is_the wrong place. Better post it in the CDT-newsgroup.

> Hi,
> Apologies if this is not the right place.
> I'm running Linux and have followed the brief tutorial found in the FAQ
> to check that I've got everything installed correctly. 
> Unfortunately, when I try to build the project I get the following
> errors:
> <quote>
> **** Incremental build of configuration Debug for project HelloWorld
> ****
> make -k all 
> Building file: ../main.cpp
> g++ -O0 -g3 -Wall -c -fmessage-length=0 -o main.o ../main.cpp
> Finished building: ../main.cpp
> Building target: HelloWorld
> g++  -o HelloWorld     main.o    
> /usr/lib/gcc-lib/i486-linux/3.3.4/../../../crt1.o(.text+0x18): In
> function `_start':
> ../sysdeps/i386/elf/start.S:98: undefined reference to `main'
> collect2: ld returned 1 exit status
> make: *** [HelloWorld] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project HelloWorld
> </quote>
> I have gcc / g++ installed correctly as other development environments
> work fine as do "hand compiled" builds. 
> I'm a bit rusty with C++ and developing on Linux in general so the above
> messages don't mean much to in terms of what to fix in order to solve
> the problem. However, I'm looking into it but would appreciate some
> pointers as to where to start and what to do to fix this problem.

Second, the error message just tells it all - it can not find a main

int main( int argc, char *argv[])
   // i.e. print that Hello World
   std::cout << "Hello World" << std::endl;
   return 0;

The main-function should reside in global namespace.

> Eclipse looks like its an excellent tool, its a shame I can't get it to
> compile code :-( 
> Thanks in advance for your help with this matter.
> Regards,
> Nicholas
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

NEU +++ DSL Komplett von GMX +++
GMX DSL-Netzanschluss + Tarif zum superg√ľnstigen Komplett-Preis!

Back to the top