Thread: a question about the windows application tutorial

  1. #1
    Registered User
    Join Date
    Jan 2005

    a question about the windows application tutorial

    hello everyone,

    on this windows application tutorial, Windows Programming , in the example code provided (on line 5) it
    #include "stdafx.h"
    and i dont have this header file (thats because i use bloodshed dev c++ v4.9.9.0, and Ken Fitlike helpfully explained it was microsoft visual specific header -- or whatever msvc stands for), so when i compile it it says missing header file... but when i delete this line a few problems occurred..

    it doesnt exactly tell me which line the problems are on, but it says

    in function `Z7WndProcP6HWND__jjl':
    undefined reference to `SetTextColor@8'
    undefined reference to `TextOutA@20'
    in function `WinMain':
    undefined reference to `GetStockObject@4'

    can anyone help me on this problem? im quite confused on this...

  2. #2
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    msvc stands for microsoft's C/C++ compiler, and since you aren't using it you shouldn't use the header. Look up those functions in whatever documentation they would have to find any replacement headers they might need

  3. #3
    Super Moderator
    Join Date
    Sep 2001
    The errors are being caused because the rest of the program assumes that you have included that library. Ken gave you some tips on what else to change in your code, so he may know what to replace these lines with. However, if this tutorial series is going to keep on using msvc stuff, and you don't want to do msvc stuff, you might want to try a different tutorial. Forger's Tutorial (google search for it) is quite good, and teaches you the original Win32 API. It's in C, but with a couple of changes to the non-windows header files, it should work - it just requires a pretty good knowledge of C/C++ syntax. There are other APIs out there like MFC and stuff. It's up to you.

  4. #4
    Registered User
    Join Date
    Jan 2005
    wow u guys sure reply faster than i expected...
    anyways, i skimmed through forger's tutorials, and it seemed pretty good. thanks for recommending it to me.

    i guess ill check his tutorials then, if msvc is that different from bloodshed. owell...

    thanks again

  5. #5
    Registered User
    Join Date
    Sep 2004
    but when i delete this line a few problems occurred
    The problems didn't occur because you deleted the include line. The errors you have are linker errors, not compiler errors. It looks like you need to link to the Gdi32 library. Read up on your compiler documentation to learn how to do this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. .NET Windows Application Question
    By obaid in forum C# Programming
    Replies: 1
    Last Post: 04-29-2008, 10:32 PM
  2. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  3. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  4. Windows form application and Windows application
    By |Wiz| in forum Windows Programming
    Replies: 5
    Last Post: 10-01-2005, 04:14 PM
  5. General question about Windows resources
    By Boomba in forum Windows Programming
    Replies: 2
    Last Post: 07-19-2004, 09:36 PM