Question about How to Build my First C++ Project (My work and my confusion is displayed on two pictures below.) I clicked Build button on the top, then click Build, but at the end of the process, I do not see 0 Errors, 0 warnings. Rather, I see this in 'Build log' "SayHello - Debug" uses an invalid compiler Skipping..." What can I do to fix this problem, specifically which compiler should I use?
Do you have the GNU compiler? If you don't then maybe you have to actually get it.
What other compiler options does it have?
I'm sure that it comes with a compiler at least.
I downloaded CodeBlocks. Would this suffice GNU compiler?
Since this is a Codeblocks issue and not a compiler issue, it is hard to say.
Would Microsoft Visual C++ 2005/2008 work? That selection is in compiler and debugger setting.
Yeah. Hope it will work. Me i use Microsoft Visual C++ 2008 and it works perfecly. Try using it.
If you are on Windows, you're more likely to have Visual C++
I think that this is CodeBlock issue too. My bro have vaguely read something online and said that to me. May I ask what a compiler is? Maybe, that would help me figure out to find what's wrong with CodeBlocks. The problem that I have is that the book revolves around using CodeBlocks, and my first chapter program would not work. :/ For now, I'll send an email to the authors, asking them directly.
Do you want my advice? Use a text editor and command line until you get a handle on things.
May I know how to get text editor? I am very new to computer science subject.
IDE is good for big projects, not necessarily for learning.
Are you on windows?
Yes, I have Window 7.
You can use Notepad. Or you can use Notepad++ if you want something a bit more advanced.
The text editor is just there for editing code. That is all it needs to do. Next you need a compiler. I recommend GCC because there is no license or any other legal nonsense to worry about. If you want GCC to work, you get MinGW at http://sourceforge.net/projects/mingw/files/
Hmmm. Thank you! ^^ I'll start with learning command lines. Then pursue learning computer language. and thank you for informing me about MinGW as well.
Once you have MinGW installed, you should have gcc/g++ What you would do is open command prompt (cmd.exe)
you would run "g++ -o <name-of-program> <file-with-code>"
For example if you had a file "hello-world.cpp", and you wanted the program to be named "helloworld" you would do `g++ -o helloword hellow-world.cpp`
ah! (nodding now in understanding) o,o
For now try to install MinGW
will get right to it. ^^
S. Korea has fast internet, right?
네 ㅎㅎㅎ. ^^ Yes, hahaha.
Did you install MinGW?
Yes. In the case for a Notepad plus plus, does the file name end with .txt? If so, would I write g++ -o wio is an awesome progammer.txt in command prompt?
first go to command prompt then type in `g++ test.cpp` Tell me what it says
After the command, it says 'g++' is not recognized as an internal or external command, operable program or batch file.
okay, do you know where you install MinGW?
Was it C:\MinGW ?
I think I have downloaded MinGW. :/ That file exists in my C drive.
Okay can open command line? Then type `cd C:\`
Or actually, can you just use explorer and go to your C drive? Then go into the MinGW folder, tell me what is in that folder.
just typed cd C:\ in command prompt.
I just want to know the directory layout of your MinGW. There should be a bin folder and in it should be gcc and g++ I want to confirm these files are there.
Yes, there is a bin folder there. In the bin folder, there is a folder called mingw-get.
This is the folder in bin.
Hmm, what is in libexec?
Inside libexec, there is a folder called mingw-get, and in that, this is the list.
Things have changed a bit since I used it.... Hmmm I guess I'll try installing it myself first and then explain what I did.
Thank you. ^^
Hmmm, let's see first of all on the installer, you want to select Basic Setup
What should I click after?
Okay so what we downloaded wasn't all of MinGW, but an installer for MinGW stuff
ah, so should I check everything within basic setup?
Nope, you wouldn't need that. Only gcc-g++ stuff
Click it, mark for install. Then go to apply changes under Installation
Downloading is in process.
You are quite a genius. o,o
go to MinGW\bin and tell me if you see g++.exe
The package is still downloading. I will check as soon as it is completed.
This is what is in the file, bin, after the installation.
can you run g++ and tell me what happens?
g++ test.cpp in command prompt, correct?
sure you can try that
you need command prompt to be navigated to that bin folder
The result is still the same.
okay, first type `cd C:\MinGW\bin`
then just type `g++`
tell me what happens.
This popup comes out. G++.exe - No Disk
Yeah, that happened to me and I was hoping it wouldn't happen to you. This is absolutely ridiculous. Let me think
No problem. ^^
May we continue our discussion tomorrow? I have to sleep now to wake up in time for school tomorrow. :/ Thank you for the your continuous help. Thank you again, wio. ^^
Sure. Good luck.
Later~
Join our real-time social learning platform and learn together with your friends!