cout

This is a discussion on cout within the C++ Programming forums, part of the General Programming Boards category; I keep getting an error when I compile but im almost 100% sure the code is correct. Well here is ...

  1. #1
    ___
    Join Date
    Jun 2003
    Posts
    806

    cout

    I keep getting an error when I compile but im almost 100% sure the code is correct. Well here is the code and error.

    Code:
    // trialrun.cpp
    // first C++ Program
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    		cout << "Some people think programming windows"
    			 << endl
    			 << "is like nailing jello to the cieling..."
    			 << endl
    			 << "easy with the right kind of nails!"
    			 << endl << endl;
    	return 0;
    }
    and then the error.

    Code:
    Compiling...
    Error spawning cl.exe
    
    Cpp1.obj - 1 error(s), 0 warning(s)

    I'm using Visual C++ 6 also. I just cant find where I went wrong on it. I checked it over and over too. Thats all it says. Now am I maybe missing a few files on VStudio or what?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  2. #2
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Sounds like visual studio isn't properly installed.

  3. #3
    ___
    Join Date
    Jun 2003
    Posts
    806
    Wait a second. I spent a fortune on that freakin software and it doesn't work right??
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  4. #4
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    i wouldnt know about that but maybe try reinstalling
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  5. #5
    ___
    Join Date
    Jun 2003
    Posts
    806
    I'll try but it better work cause I just bought myself a book on VC++ 6 today and I'm really SOL if I can't get it working
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  6. #6
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Nothing wrong with the code itself.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  7. #7
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Yeah, it looks like a compiler setup or configuration problem. If I remember correctly, cl is the command-line command to compile and link using MSVC++.

    Did you create a new console project and then add your cpp file to it?

    BTW - Every time I've installed a new compiler, I've had difficulty getting it to work the first time... There is always something tricky about the setup and configuration!

  8. #8
    ___
    Join Date
    Jun 2003
    Posts
    806
    Yeah. I opened VC++ started a new project as a consol app. Then opened a C++ source file put the code in and tried to compile and got the error.
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  9. #9
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Try uninstalling and reinstalling VC++, the error is it not being able to find one of the many Visual C++ executables. Nothing at all is wrong with the code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. class methods to cout stream
    By shintaro in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2008, 06:27 PM
  2. cout vs std::cout
    By none in forum C++ Programming
    Replies: 10
    Last Post: 07-26-2004, 11:20 PM
  3. changing cout output
    By Yohumbus in forum C++ Programming
    Replies: 1
    Last Post: 10-23-2002, 04:09 AM
  4. Redirecting cout stream
    By Arrow Mk84 in forum C++ Programming
    Replies: 1
    Last Post: 10-08-2002, 04:17 PM
  5. printf vs cout
    By RyeDunn in forum C++ Programming
    Replies: 5
    Last Post: 07-09-2002, 04:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21