473,383 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

compile hello world

Greetings:
I am trying to compile the following code via command line.
It compiles just fine in visual studio 2002 v7 so i took looked at the
properties and i

got the following command line options, but when i try to compile i
get the errors listed

below. Can anyone give me a suggestion on how to compile this program?

#include <iostream>

using namespace std;

int main() {
cout << "Hello World" << endl;
return 0;
}

cl /nologo /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm
/EHsc /RTC1 /MLd

/Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP
example.cpp
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xstring(1286) : warnin
g C4346: 'std::basic_string<_Elem,_Traits,_Ax>::size_type' : dependent
name is n
ot a type
prefix with 'typename' to indicate a type
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xstring(1286) : error
C2143: syntax error : missing ';' before
'std::basic_string<_Elem,_Traits,_Ax>::
npos'
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xstring(1286) : error
C2501: 'std::basic_string<_Elem,_Traits,_Ax>::size_type' : missing
storage-class
or type specifiers
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\typeinfo.h(53) :
error C2989: 'type_info' : template class has already been defined as
a non-temp
late class
predefined C++ types (compiler internal)(96) : see declaration
of 'type_
info'
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xlocinfo.h(48) : error
C2143: syntax error : missing ';' before 'identifier'
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xlocinfo.h(48) : warni
ng C4091: 'typedef ' : ignored on left of '_Collvec' when no variable
is declare
d
c:\Program Files\Microsoft Visual Studio
..NET\Vc7\include\xlocinfo.h(48) : fatal
error C1004: unexpected end of file found

thanks,

brian
Jul 19 '05 #1
9 6735
Brian wrote:
Greetings:
I am trying to compile the following code via command line.
It compiles just fine in visual studio 2002 v7 so i took looked at the
properties and i

got the following command line options, but when i try to compile i
get the errors listed

below. Can anyone give me a suggestion on how to compile this program?


This newsgroup covers only the standard C++ language, of which compiler
command line options are not a part. Please consult a newsgroup where your
query is on topic, such as the microsoft.public.* groups.

--
Unforgiven

A: Top Posting!
Q: What is the most annoying thing on Usenet?

Jul 19 '05 #2
"Brian" <b1*******@hotmail.com> wrote...
Greetings:
I am trying to compile the following code via command line.
It compiles just fine in visual studio 2002 v7 so i took looked at the
properties and i

got the following command line options, but when i try to compile i
get the errors listed

below. Can anyone give me a suggestion on how to compile this program?

#include <iostream>

using namespace std;

int main() {
cout << "Hello World" << endl;
return 0;
}


The code is fine. The errors you get are due to either installation
issues or wrong command-line options you're passing to the compiler.

Alas, command-line options of different compilers are off-topic here.
Please ask in microsoft.public.vc.language or some other relevant
VC++ newsgroup.

Victor

Jul 19 '05 #3

"Brian" <b1*******@hotmail.com> wrote in message
news:3b**************************@posting.google.c om...
Greetings:
I am trying to compile the following code via command line.
It compiles just fine in visual studio 2002 v7 so i took looked at the
properties and i

got the following command line options, but when i try to compile i
get the errors listed

below. Can anyone give me a suggestion on how to compile this program?

#include <iostream>

using namespace std;

int main() {
cout << "Hello World" << endl;
return 0;
}


In visual studio, endl is not suppported. I usually use ENDL and #define
ENDL "\n"
Allan
Jul 19 '05 #4
"Allan Bruce" <al*****@TAKEAWAYf2s.com> wrote in message
news:bm**********@news.freedom2surf.net...

"Brian" <b1*******@hotmail.com> wrote in message
news:3b**************************@posting.google.c om...
Greetings:
I am trying to compile the following code via command line.
It compiles just fine in visual studio 2002 v7 so i took looked at the
properties and i

got the following command line options, but when i try to compile i
get the errors listed

below. Can anyone give me a suggestion on how to compile this program?

#include <iostream>

using namespace std;

int main() {
cout << "Hello World" << endl;
return 0;
}


In visual studio, endl is not suppported. I usually use ENDL and #define
ENDL "\n"


Don't be ridiculous. VC++ supports endl just fine.

Newbie alert!! Previous post is in error.
But please take Microsoft compiler questions to the Microsoft newsgroups.
--
Gary
Jul 19 '05 #5
Allan Bruce wrote:
[snip]

In visual studio, endl is not suppported. I usually use ENDL and #define
ENDL "\n"
Allan


Eh?? Are you sure about that? I've been using endl for ages with VC++.
Look it
up in MSDN library.

James
Jul 19 '05 #6
> > In visual studio, endl is not suppported. I usually use ENDL and
#define
ENDL "\n"


Don't be ridiculous. VC++ supports endl just fine.

Newbie alert!! Previous post is in error.
But please take Microsoft compiler questions to the Microsoft newsgroups.


ok, please forgive me, I forgot to use std::endl, since I dont declare to
use a namesapce.
BTW, Which post is in error?
Jul 19 '05 #7
"Allan Bruce" <al*****@TAKEAWAYf2s.com> wrote in message
news:bm**********@news.freedom2surf.net...
In visual studio, endl is not suppported. I usually use ENDL and #define ENDL "\n"
<<snip>> BTW, Which post is in error?


The one that says : "In visual studio, endl is not suppported."
--
Gary
Jul 19 '05 #8
Allan Bruce wrote:
In visual studio, endl is not suppported. I usually use ENDL and
#define ENDL "\n"


In addition to the fact that std::endl is supported just fine in all
versions of VC I've ever used, as other posters have already stated, I would
like to add that your macro is NOT equivalent to std::endl.

What std::endl actually does is insert a new line, and flush the buffer. So
your macro would need to be (if it would be needed, which it's not):
#define ENDL "\n" << std::flush

Ah... talk of endl and flush always takes me back to first year at Uni: my
programming course instructor would insist you have to use std::endl instead
of just "\n" in case the computer explodes right after the statement. Yep,
those were his exact words (well, not exactly, he said it in Dutch, but you
get the idea). ^_^

More realistically, I've had situations where a line would not show up if
the program terminated unexpectedly after the std::cout statement if I
didn't use endl or flush.

--
Unforgiven

A: Top Posting!
Q: What is the most annoying thing on Usenet?

Jul 19 '05 #9
Faz
"Brian" <b1*******@hotmail.com> wrote in message
news:<3b**************************@posting.google. com>...
I am trying to compile the following code via command line. It compiles just fine in visual studio 2002 v7 so i took looked at the properties and i got the following command line options, but when i try to compile i get the errors listed below. Can anyone give me a suggestion on how to compile this program?


[gripping list of errors omitted]

There is a batch file provided in the installation called something like
vcvars.bat, if I recall correctly. This sets up the environment variables so
that the standard headers and the libraries can be found by the compiler and
linker. Run that batch file within the console session before executing
your compiler. Maybe that's your problem.. for some weird reason I didn't
get the urge to comb through the errors :-P

Good luck,

Fazl

Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ping | last post by:
Hello everyone! I had already installed VC6.0 in my computer, then i installed the Vs.net. I wrote some programs of vs.net with the UtraEdit and compiled them in command line. For example, i wrote...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
12
by: JS | last post by:
I use winXP and have installed Cygwin. I use Dev-C++ and the Cygwin compiler, but for some reason I can't compile this code: #include <setjmp.h> #include <stdio.h> #include <stdlib.h> ...
0
by: jtbaccarat | last post by:
The sample Hello World app found in .NET Framework SDK\Tutorials\Hello World, will not compile a .exe file. The build.bat file source code is: @ REM Set command switch for building debug or...
7
by: dc | last post by:
Can anybody think of a situation where virtual function's address resolution/ something related to virtual is done at compile time
1
by: 张沈鹏 | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2,...
4
by: Susan Rice | last post by:
I'm new to using CString. Why won't the following compile? I'm using Microsoft Visual C++ 6.0 Line 37 which it complains about is the function: 37 CString ConvertFile(char *szFileName) I...
5
by: ganesh.kundapur | last post by:
Hi, I want to know how to compile the C source file without using the compiler directly. I mean to say by using compiler componets such as ( cpp, cc, as, ld ). I tried to compile the fallowing...
2
by: George2 | last post by:
Hello everyone, The compile error of the following code is, foo.cpp(7) : error C2146: syntax error : missing ';' before identifier '_' foo.cpp(7) : error C2065: '_' : undeclared identifier...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.