Need help with compiler problem

This is a discussion on Need help with compiler problem within the C++ Programming forums, part of the General Programming Boards category; Well I've been trying to get started with C++, but when I include iostream to input and output information to/from ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    4

    Need help with compiler problem

    Well I've been trying to get started with C++, but when I include iostream to input and output information to/from the console I get these errors:


    http://pastebin.com/m7ffb373a

    I was wondering whether anyone could tell me how to fix this, the only thing in the script is main and that has nothing in it.

    Thanks

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    No clue without seeing the code. Someone else may, but it's often easier to see the code first, then the error messages.

    And, I'd like to point out that a simple mistake can lead to LOTS of errors, if you manage to get the compiler a bit "confused" about what's going on.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    It's literally just:

    Code:
    #include <iostream>
    
    int main()
    {
    	return 0;
    }

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Hmm. That should definitely work - are you perhaps compiling it as C instead of C++? What's the name of the file?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    Source1.cpp

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,718
    are you perhaps compiling it as C instead of C++?
    I have my doubts, since the compiler can suggest "prefix with 'typename' to indicate a type". Would a C compiler report that (even one that is normally in C++ mode)?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    You aren't by chance using VC6 are you? The path to the header files kinda suggests it.
    If so, you'll either need to put a .h on the end of the include file name, or get a better compiler.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    If I add .h I get:

    Code:
    c:\program files\microsoft visual studio\vc98\include\streamb.h(158) : warning C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data
    c:\program files\microsoft visual studio\vc98\include\streamb.h(159) : warning C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data
    c:\program files\microsoft visual studio\vc98\include\streamb.h(170) : warning C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data
    Linking...
    LINK : fatal error LNK1104: cannot open file 'msvcirtd.lib'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev-C++ compiler problem
    By GrasshopperEsq in forum C++ Programming
    Replies: 19
    Last Post: 05-08-2008, 02:35 AM
  2. Compiler Problem
    By sitestem in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2004, 03:48 PM
  3. Replies: 5
    Last Post: 12-03-2003, 04:47 PM
  4. Problem with compiler
    By knight543 in forum C++ Programming
    Replies: 4
    Last Post: 02-09-2002, 08:16 PM
  5. Please help me with this compiler problem
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2002, 04:14 PM

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