Help with eclipse c ++

2

When I compile the example hello world that brings eclipse compiles me well

but if I create it from scratch in another project I get this error

   11:42:22 **** Rebuild of configuration Debug for project hello 2 ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o "src\hello 2.o" "..\src\hello 2.cpp" 
g++ -o "hello 2.exe" "src\hello 2.o" 
c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../libmingw32.a(main.o):(.text.startup+0xa7): undefined reference to '[email protected]'
collect2.exe: error: ld returned 1 exit status

11:42:23 Build Finished (took 422ms)

    
asked by erik 15.04.2016 в 16:48
source

2 answers

1

My problem caught my attention since the error message:

  

undefined reference to 'WinMain @ 16'

Generally refers to that you do not have an "Entry Point", in short a main() defined.

But from what I see these are starting in C ++ since you created a "Hello world", you want to create your project as "console program", you are probably creating it as "Windows program" . . p>     

answered by 25.04.2016 в 14:36
0

Obviously the error is not code, but the file where the file is being saved, try not to save the names of files with spaces and if you need to distinguish between two words is good practice, write nombre1Nombre2 , or nombre1_nombre2 .

    
answered by 25.04.2016 в 05:40