Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't compile source code

Status
Not open for further replies.

xlav

Technical User
Oct 23, 2003
223
0
0
JM
Created Console Application project and wrote C++ source code in Visual C++ 6.0. Clicked Build - Compile file, and file doesn't compile. No window opens at bottom showing number of errors and warnings. Clicked run symbol (!) and message pops up saying 'file does not exist and if I want to build it'. Click yes but file still doesn't compile.

-x
 
it means you have errors in your source code. Read the errors which compiller gives to you and correct them one by one, beginning from the first. Sometimes it is enough all errors to disappear if you correct the only first one.

Ion Filipski
1c.bmp
 
No window with error or warning information appears.
Code;

#include<iostream.h>
#include<stdio.h>
#include<stdlib.h>

main()
{
cout << &quot;Hello World&quot; << endl;
cout << &quot;END &quot; << endl;
return 0;
}

-x
 
#include<iostream>
using namespace std;
main()
{
cout << &quot;Hello World&quot; << endl;
cout << &quot;END &quot; << endl;
return 0;
}


Ion Filipski
1c.bmp
 
I only have vis 7.0 and it compiled fine, however
1: use iostream and namespace std
Code:
#include <iostream>
int main()
{
using std::cout;
using std::endl;
cout << &quot;Hello World&quot;<<endl;
return 0;
}
2: specify that main have a return type of int
WR
 
Is the code actually part of the project? You may not be compiling it because the program has no files to compile. Go to the File View and make sure the source directory contains your file. If it does, double click it and make sure it is the &quot;right&quot; one :)

Matt
 
Thanks for all your help. The compile results window was covered over and I had to click on the application window bottom line and drag it up.
-x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top