|
From: Per W. <pw...@ia...> - 2005-07-11 20:44:28
|
Empty lines does not matter at all - C and C++ allows white space
(space, tab, newline, ...) to be
inserted just about anywhere.
The places where you should avoid placing white spacing is:
- Within ''
- Within ""
- Between digits of a number
- Between charactesr (and digits) of a function or variable name.
Anyway, this is what I did:
I opened Dev-C++ - the machine I currently sit at have version 4.9.9.2
installed, but it should work the same with all versions that starts with
4.9.
Selected File/New/Project
Specified 'Empty Project' and pressed 'Ok'.
Created a new directory named 'hello' and moved into it.
Named the project 'hello.dev' and pressed 'Save'.
Made sure that the 'Project' tab was selected on the left side of the IDE
and then right-clicked on the top-most item in the tree.
Selected 'New file'.
Cut the source code from your mail and pasted into the new editor view.
Pressed Ctrl-S to save. Specified the name 'hello.cpp' and pressed the
'Save' button.
Pressed Ctrl-F9 to compile. A popup dialog displays 'Status: Done'
If I close the popup dialog and at the bottom of the Dev-C++ window select
the 'Compile Log' tab, I find the following 8 lines of text:
Compiler: Default compiler
Building Makefile: "C:\usr\src\test\hello\Makefile.win"
Executing make...
make.exe -f "C:\usr\src\test\hello\Makefile.win" all
g++.exe hello.o -o "hello.exe" -L"C:/tools/Dev-Cpp/lib"
Execution terminated
Compilation successful
If I then press F9 a new text window is started with the running program.
The following two lines are output:
Hello World!
Press any key to continue . . .
If you get into troubles when compiling the program, we can help you if
you do two things:
Select every single character in the edit window and paste into your mail
- I assume you have already done this, since the code I cut from your
previous mail did compile and did work.
Select the 'Compile Log' tab in the bottom of the Dev-C++ window. To the
left of the tab, there is two fields:
'Total Errors:' and 'Size of Output:' and to the right is a field 'Compile
Log:'
Copy these three fields (actually, the Compile Log: field to the right is
enough) and paste into your mail.
By looking at both your source code and the output text from building the
application, we should be able to figure out what goes wrong.
/Per W
On Mon, 11 Jul 2005, yakir arbib wrote:
> Hi
> Thanks for that man
> I tried doing what you sed:
> I went to notepad,rote the code you gave me,and pressed control+c to
> coppy it,and then I pasted it to dev
> I created a new projektand deleted what dev rote there,I pasted in the
> code,pressed control+f9 to compile,and this is what went out
> #include <iostream>
> #include <cstdlib>
> using namespace std;
>
> int main()
> {
> cout << "Hello World!\n";
> system("PAUSE");
> return 0;
> }
> But there wher stil errors,I'm starting to get despret
> And I have another question:
> Are the blank lines important?
> I mean, if I write:
> #include <iostream>
>
> #include <cstdlib>
> Or:
> #include <iostream>
> #include <cstdlib>
> I mean,do the blank lines represent something?
> Or I can write how I linke
> And about my main problem that I can't compile anything, perhaps can you
> figur the problem in the code I rote above?
> Or tell me how to use mingw with out the dev ide
> Thanks
> yakir
>
|