pdh.a Missing?

This is a discussion on pdh.a Missing? within the Windows Programming forums, part of the Platform Specific Boards category; I noticed that I have the .h file for Pdh, but not the library file for it. I am using ...

  1. #1
    HelpingYouHelpUsHelpUsAll
    Join Date
    Dec 2007
    Location
    In your nightmares
    Posts
    223

    pdh.a Missing?

    I noticed that I have the .h file for Pdh, but not the library file for it. I am using Dev-C++ so all the files a .a so following the naming convention it would be libpdh.a that is missing. I tried copying a .lib from lcc-Win32's lib directory but that gave an "File format not recognized". If anyone could either post the links to them or post them (they should be like dlls - free to download) that would be great, so I can debug this program. Thanks.
    long time no C; //seige
    You miss 100% of the people you don't C;
    Code:
    if (language != LANG_C && language != LANG_CPP)
        drown(language);

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    IIRC, there's a tool to convert a .lib to a .a
    Look in the dev-c++ bin directory.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    HelpingYouHelpUsHelpUsAll
    Join Date
    Dec 2007
    Location
    In your nightmares
    Posts
    223
    Quote Originally Posted by Salem View Post
    IIRC, there's a tool to convert a .lib to a .a
    Look in the dev-c++ bin directory.
    Since I am missing this file it should come as no surprise that I don't have this tool - It is a wonder the program ships with anything (ha, run it to discover you need to download the rest of the files manually). I don't have IIRC and just becuase I need it, I haven't found anywhere to download it. I have gone through all of the programs in the bin directory and none of them will take .lib files. Any suggestions?
    long time no C; //seige
    You miss 100% of the people you don't C;
    Code:
    if (language != LANG_C && language != LANG_CPP)
        drown(language);

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,974
    Perhaps lcc-Win32's lib files are not compatible with MSVC/MinGW. I had the impression that the MinGW port of gcc and g++ can use the MSVC lib files simply by renaming them to have a .a extension.

    With the dll and the corresponding .def file, you could use MinGW's dlltool to generate the library archive for you, so perhaps you could check if a .def file is supplied with the library.
    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

  5. #5
    HelpingYouHelpUsHelpUsAll
    Join Date
    Dec 2007
    Location
    In your nightmares
    Posts
    223
    Nope, renaming extensions is always one of the first things I try. They are a different file format and not compatible with each other (why couldn't they just stick to one file type, so every compiler either uses lib or a files). With my luck, I don't have any .def files (except the one for the dll that I wrote, doesn't count though). I do have dlltool though.
    long time no C; //seige
    You miss 100% of the people you don't C;
    Code:
    if (language != LANG_C && language != LANG_CPP)
        drown(language);

  6. #6
    HelpingYouHelpUsHelpUsAll
    Join Date
    Dec 2007
    Location
    In your nightmares
    Posts
    223
    /*Don't worry I found the file on the same site.
    I found a .def file for pdh (googled pdh.def which took me so long to think of), I tried compiling it with dlltool but it returns:
    Code:
     [Linker error] undefined reference to `PdhEnumObjectItemsA@36'
    I am using this to compile to .a is it right as dlltools syntax is a bit cryptic?:
    Code:
    bin\dlltool -l lib\libpdh.a lib\pdh.lib lib\pdh.def
    I have also tried using -l and -e to no avail. Hope this is an easier question to answer.*/
    Now, why does Dev-C++ not like this:
    Code:
    INITCOMMONCONTROLSEX cc;
    //Gives: 584 `INITCOMMONCONTROLSEX' undeclared (first use in this function) and syntax error before "cc"
    This program did compile in lcc-Win32, but I want to debug it in Dev-Cpp, to fix some memory and refreshing error. Try and find out why each time the LV refreshes it uses more & more memory...
    Last edited by P4R4N01D; 06-04-2008 at 12:37 AM. Reason: Fixed one problem now onto another...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 02:49 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 03:49 AM

Tags for this Thread


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