0
votes

I just have followed the tutorials from: https://www.youtube.com/watch?v=57dbxWj7b4U to install c++, but I can't build the project even I take the example project in eclipse: "Hello World c++ Project".The building seems successful, for exe file is generated, and concole shows

13:38:04 **** Incremental Build of configuration Release for project FirstC ****
Info: Internal Builder is used for build
g++ -O3 -Wall -c -fmessage-length=0 -o FirstProgram.o "..\\FirstProgram.cpp" 
g++ -o FirstC.exe FirstProgram.o 

13:38:05 Build Finished (took 1s.90ms)

But when I press "run", it says "Info: Nothing to build for TestProject", as the enclosed picture.

enter image description here The system path is as following: "c:\program files\gcc\bin;c:\program files\gcc\libexec\gcc\x86_64-pc-mingw32\5.3.0;%MINGW_HOME%\bin;%MSYS_HOME%bin;C:\Program Files (x86)\Java\jre1.8.0_25\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files\GDAL\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\nodejs\".

What will the reason probably be? I have install java several days before, and just install c++ today. Will they conflict?

2
Browse your output folder and look if the exe is there. And then you could try to run it from a mingw shell or something. Eclipse is a bit tricky to set up debug/run configurations. Some menu clicking is usually involved. If you plan on programming on windows anyway, you could also consider to install the free VS2015 community edition, which iMHO is easier to use.BitTickler
Is Eclipse configured to use your executable when you run? It was some time ago since I worked with Eclipse, but I think you had to be explicitly selecting the correct project and run it the first time. There must also be some configuration to set up what binary to run, check that to see if your executable program is selected.Some programmer dude
I think the project should be configured. I select the project and right click to select run as.."local c/c++ application" since there is only one option.sindy
I add a breakpoint at the sentence "cout\\..." and debug, it turns out error as "No source available for "main() at 0x4080e3" ". What does it mean?sindy
The "no source available" error is because you built the app in release without debug info included ("Incremental Build of configuration Release"). Switch to the Debug configuration to be able to debug.axalis

2 Answers

1
votes

"Nothing to build for TestProject" means that the project was already built before and nothing changed since then, so the project does not need to rebuild.

If you change anything in the source code, save and try again, the project should then rebuild again (once).

0
votes

I have restarted the computer and now it runs well, and "hello world" comes out. I'm fooled by the system and feel so tired.....