C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-02-2008, 01:36 AM   #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);
P4R4N01D is offline   Reply With Quote
Old 06-02-2008, 11:09 AM   #2
and the hat of vanishing
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,214
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.
Up to 8Mb PlusNet broadband from only £5.99 a month!
Salem is offline   Reply With Quote
Old 06-02-2008, 11:57 PM   #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);
P4R4N01D is offline   Reply With Quote
Old 06-03-2008, 12:12 AM   #4
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 10,365
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
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is online now   Reply With Quote
Old 06-03-2008, 12:29 AM   #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);
P4R4N01D is offline   Reply With Quote
Old 06-04-2008, 12:29 AM   #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...
P4R4N01D is offline   Reply With Quote
Reply

Tags
library

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 07:20 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

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