How to get psapi.h working?

This is a discussion on How to get psapi.h working? within the C++ Programming forums, part of the General Programming Boards category; How to get psapi.h working?...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    How to get psapi.h working?

    How to get psapi.h working?

  2. #2
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Include it and make sure to link with the library associated with it.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    library??

    How to link the library?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >How to link the library?
    How to give details about your compiler and operating system when asking a question that depends on such information?
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    Os= Windows XP
    Compiler= Visual Studio 6.0
    prog language= C++

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Under the Projects menu there's a Properties (or Settings, I can't quite remember) dialog where you can specify what libraries to link with.
    My best code is written with the delete key.

  7. #7
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Aye...it's "Settings". Under the "Link" tab where it says "Object/library modules," type in the name of the library file.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  8. #8
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    even after entering the psapi.lib, i get the following error message:

    fatal error C1083: Cannot open include file: 'psapi.h': No such file or directory

    I have just installed the latest SDK, but still it is not resolved!

  9. #9
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Does your compiler know to look to the SDK for includes & Libraries. Cant remember how to set this in Version 6, but with NET it's something like Tools->Options->Projects Directories. There you can set include folders and lib folders for the SDK

  10. #10
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    the process is the same in VC++ 6.0 but which folder/files should i specify?

  11. #11
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    OK, i have specified the include and lib folders of the SDK, added psapi.lib to the settings, now i am getting this following error only:

    LINK : fatal error LNK1104: cannot open file "psapi.lib"
    Error executing link.exe.

    Any helpful comments?

  12. #12
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Make sure to add the path to the library file to the paths under the "Link" tab, "Input" category.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  13. #13
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    Having done that, got the following errors:

    Linking...
    EnumProcesses.obj : error LNK2001: unresolved external symbol "void __cdecl setrgb(int,int)" (?setrgb@@YAXHH@Z)
    EnumProcesses.obj : error LNK2001: unresolved external symbol "void __cdecl gotoxy(int,int)" (?gotoxy@@YAXHH@Z)
    EnumProcesses.obj : error LNK2001: unresolved external symbol "void __cdecl clrscr(int)" (?clrscr@@YAXH@Z)
    Debug/EnumProcesses.exe : fatal error LNK1120: 3 unresolved externals
    Error executing link.exe.

    EnumProcesses.exe - 4 error(s), 0 warning(s)

  14. #14
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    That has nothing to do with psapi. Those are non-standard console screen manipulation routines. The correct way to do these things on a Windows box with the Console API is covered in my 6 part Windows Console Programming Tutorial .
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  15. #15
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    Thanks for all ur inputs!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function not working
    By sloopy in forum C Programming
    Replies: 31
    Last Post: 11-12-2005, 08:08 PM
  2. Program Not working Right
    By raven420smoke in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2005, 04:21 AM
  3. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 08:47 PM
  4. x on upper right corner not working
    By caduardo21 in forum Windows Programming
    Replies: 1
    Last Post: 02-20-2005, 08:35 PM
  5. cygwin -> unix , my code not working properly ;(
    By CyC|OpS in forum C Programming
    Replies: 4
    Last Post: 05-18-2002, 05:08 AM

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