Thread: Problem with #include "stdafx.h"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    SetTextColor requires you to link with gdi32.lib (or gdi32.dll). (EDIT: MSDN will tell you what libraries are needed for the Windows API functions.)

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    120
    Yes, i have included the windows.h, but it still gives me that error,

    and how can i link that dll??

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by shiroaisu View Post
    Yes, i have included the windows.h, but it still gives me that error,

    and how can i link that dll??
    The header files and the libraries are not the same thing. You need windows.h as a header, but you need to link with (not include) the library (not header file) gdi32.lib. You'll need to go to your linker properties and add the library.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with simple socket client/server program
    By spencer88 in forum C Programming
    Replies: 6
    Last Post: 05-05-2009, 11:05 PM
  2. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  3. include problem
    By Strait in forum C++ Programming
    Replies: 4
    Last Post: 01-31-2005, 04:01 PM
  4. Read and write hanging
    By zee in forum C Programming
    Replies: 8
    Last Post: 08-03-2004, 11:19 PM
  5. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 01:21 PM