Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 140943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:41:49+00:00 2026-05-11T07:41:49+00:00

I have a problem running a simple Hello-world program in C++ on my Windows

  • 0

I have a problem running a simple Hello-world program in C++ on my Windows XP. I have written a post here:

Using the g++ C++ compiler from cygwin

where I stated the problem and I received many helpful replies, which solved some things. However, I still cannot run my hello-world program. Please, have a look at the post, I have included the program there. A friend of mine is able to run this program on his machine without problems. So, the problem should be in my system or libraries or something else, but I cannot figure what. In the ‘Edited’ section of my post, I have included what error messages exactly I get.

Here is what I receive when I try to compile the program like this:

g++ hello.cpp

From the cygwin shell:

When I try g++ hello.cpp, I get:

hello.cpp:1: parse error before character 0357 hello.cpp: In function 'int main()': hello.cpp:'cout' undeclared (first use this function) hello.cpp: (Each undeclared identifier is reported only once hello.cpp: for each function it appears in.) hello.cpp: 'endl' undeclared (first use this function) g++.exe: hello.cpp: No such file or directory g++.exe: No input files g++.exe: hello.cpp: No such file or directory g++.exe: No input files g++.exe: hello.cpp: No such file or directory g++.exe: No input files g++.exe: hello.cpp: No such file or directory g++.exe: No input files g++.exe: hello.cpp: No such file or directory g++.exe: No input files 

And here is what I get when I try to compile the program (again with g++ hello.cpp) from the DOS command prompt:

When I try g++ hello.cpp, I get:

hello.cpp:1: parse error before character 0357 hello.cpp: In function 'int main()': hello.cpp:'cout' undeclared (first use this function) hello.cpp: (Each undeclared identifier is reported only once hello.cpp: for each function it appears in.) hello.cpp: 'endl' undeclared (first use this function) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:41:50+00:00Added an answer on May 11, 2026 at 7:41 am

    It looks like you have somehow got an illegal character in your code. Did you type the code in yourself or copy & paste it? If the latter, the source you copied from may be suspect in some way – type the code into the editor yourself, save it and recompile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 106k
  • Answers 106k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer HttpsURLConnection extends HttpUrlConnection, so you do not need the HttpsUrlConnection,… May 11, 2026 at 8:52 pm
  • Editorial Team
    Editorial Team added an answer What happened before you started caching the connections? Did caching… May 11, 2026 at 8:52 pm
  • Editorial Team
    Editorial Team added an answer Non-IE browsers are even worse on that page. Your images… May 11, 2026 at 8:52 pm

Related Questions

I'm running an Apache 2 and PHP 5.2 configuration, and for some reason, PHP
I've been running into problem after problem trying to use the a third party
Ok, so I have a very simple form with next to no logic in
Is there any built in support in jQuery for basic assertion checking, primarily of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.