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.
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?
Originally Posted by Salem
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.
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.
/*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:
I am using this to compile to .a is it right as dlltools syntax is a bit cryptic?:
[Linker error] undefined reference to `PdhEnumObjectItemsA@36'
I have also tried using -l and -e to no avail. Hope this is an easier question to answer.*/
bin\dlltool -l lib\libpdh.a lib\pdh.lib lib\pdh.def
Now, why does Dev-C++ not like this:
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...
//Gives: 584 `INITCOMMONCONTROLSEX' undeclared (first use in this function) and syntax error before "cc"