Help! Dev Messed up!!

This is a discussion on Help! Dev Messed up!! within the C++ Programming forums, part of the General Programming Boards category; Dont bother cout text. Its Swedish. When i compile this : #include <iostream> int main () { int money; int ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    23

    Exclamation Help! Dev Messed up!!

    Dont bother cout text.
    Its Swedish.

    When i compile this :

    #include <iostream>

    int main ()
    {
    int money;

    int ihave = 188;


    int lost;

    cout << "Hur mycket pengar har du tjänat den här månaden?" << endl;

    cin>>money;

    cout << "Hur mycket pengar har du förlorat den här månaden?" << endl;

    cin>>lost;

    lost -= ihave;
    money += ihave;

    cout << "Så här mycket pengar har du nu!" << endl;

    cout << ihave << endl;


    return 0;
    }


    i get this error:


    C:\WINDOWS\TEMP\cctfDagb.o(.text+0x94):pengar.cpp: undefined reference to `GetStockObject@4'

    Anybody knows whats wrong?

    And by the way, should i make this a console application or a windows?
    .. zzz soooo tireed.

  2. #2
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    It should be console, and maybe it is an error because of that, or because you did not put "using namespace std;".

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    23

    uhhmm

    When i compile as a console i get 6 errors.

    When i compile as windows i only get that error.

    Ill try to add the thing you told me.
    .. zzz soooo tireed.

  4. #4
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    This code should compile without errors as a console application"

    Code:
    #include <iostream> 
    
      using namespace std;
    
    int main () 
    { 
      int money; 
      int ihave = 188; 
    
      int lost; 
    
      cout << "Hur mycket pengar har du tjänat den här månaden?" << endl; 
      cin>>money; 
    
      cout << "Hur mycket pengar har du förlorat den här månaden?" << endl; 
      cin>>lost; 
    
      lost -= ihave; 
      money += ihave; 
    
      cout << "Så här mycket pengar har du nu!" << endl; 
    
      cout << ihave << endl; 
    
    
      return 0; 
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 12:05 AM
  2. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 07:43 PM
  3. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 1
    Last Post: 03-08-2004, 04:19 PM
  4. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 09:40 PM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 06:42 PM

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