#include <QtCore/QCoreApplication>#define _WIN32_DCOM#include <rpcsal.h>#include "qt_windows.h"#include <wbemidl.h>using namespace std;
QT -= guiINCLUDEPATH += C:/Qt/2009.04/qt/libLIBS += C:/Qt/2009.04/qt/lib/wbemuuid.LibTARGET = qt_wmiCONFIG += consoleCONFIG -= app_bundleTEMPLATE = appSOURCES += main.cpp
Running build steps for project qt_wmi...Configuration unchanged, skipping QMake step.Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w mingw32-make: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'c:\Qt\2009.04\qt\bin\qmake.exe -spec c:\Qt\2009.04\qt\mkspecs\win32-g++ -win32 -o Makefile qt_wmi.promingw32-make: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'mingw32-make: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debugmingw32-make[1]: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\qt_wmi.exe debug/main.o -L"c:\Qt\2009.04\qt\lib" C:/Qt/2009.04/qt/lib/wbemuuid.Lib -lQtCored4mingw32-make[1]: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'mingw32-make: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'debug/main.o: In function `Z7cpuDatav':Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:43: undefined reference to `CoInitializeEx@8'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:62: undefined reference to `CoInitializeSecurity@36'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:69: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:81: undefined reference to `CoCreateInstance@20'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:87: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:120: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:134: undefined reference to `CoSetProxyBlanket@32'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:142: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:160: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:201: undefined reference to `VariantClear@4'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:224: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:238: undefined reference to `CoSetProxyBlanket@32'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:246: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:264: undefined reference to `CoUninitialize@0'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:288: undefined reference to `VariantClear@4'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:300: undefined reference to `CoUninitialize@0'collect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\qt_wmi.exe] Error 1mingw32-make: *** [debug] Error 2Exited with code 2.Error while building project qt_wmiWhen executing build step 'Make'
Running build steps for project qt_wmi...Configuration unchanged, skipping QMake step.Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w mingw32-make: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'c:\Qt\2009.04\qt\bin\qmake.exe -spec c:\Qt\2009.04\qt\mkspecs\win32-g++ -win32 -o Makefile qt_wmi.promingw32-make: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'mingw32-make: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debugmingw32-make[1]: Entering directory `Q:/Darbai/c++/qt_wmi/qt_wmi'g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\qt_wmi.exe debug/main.o -L"c:\Qt\2009.04\qt\lib" -lC:/Qt/2009.04/qt/lib/wbemuuid.Lib -lQtCored4mingw32-make[1]: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'mingw32-make: Leaving directory `Q:/Darbai/c++/qt_wmi/qt_wmi'c:/qt/2009.04/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lC:/Qt/2009.04/qt/lib/wbemuuid.Libcollect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\qt_wmi.exe] Error 1mingw32-make: *** [debug] Error 2Exited with code 2.Error while building project qt_wmiWhen executing build step 'Make'
debug/main.o: In function `main':Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:29: undefined reference to `_imp___ZN16QCoreApplicationC1ERiPPc'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:31: undefined reference to `_imp___ZN16QCoreApplication4execEv'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:31: undefined reference to `_imp___ZN16QCoreApplicationD1Ev'Q:\Darbai\c++\qt_wmi\qt_wmi/main.cpp:31: undefined reference to `_imp___ZN16QCoreApplicationD1Ev'
DispHelper is a COM helper library that can be used in C++ or even plain C. No MFC or ATL is required.It allows you to call COM objects with an easy printf style syntax.It is compatible with most Windows compilers including Dev-C++, Visual C++ and LCC-WIN32.Including DispHelper in your project couldn't be simpler as it is available in a compacted single file version.Included with DispHelper are over 20 samples that demonstrate using COM objects including ADO, CDO, Outlook, Eudora, Excel,Word, Internet Explorer, MSHTML, PocketSoap, Word Perfect, MS Agent, SAPI, MSXML, WIA, dexplorer and WMI.
debug/main.o: In function `Z8HotFixesPKw':Q:\Darbai\c++\qt_dispHelper/main.cpp:50: undefined reference to `dhGetObject'mingw32-make[1]: Leaving directory `Q:/Darbai/c++/qt_dispHelper'mingw32-make: Leaving directory `Q:/Darbai/c++/qt_dispHelper'Q:\Darbai\c++\qt_dispHelper/main.cpp:53: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:55: undefined reference to `dhEnumBegin'Q:\Darbai\c++\qt_dispHelper/main.cpp:59: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:60: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:61: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:62: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:63: undefined reference to `dhGetValue'Q:\Darbai\c++\qt_dispHelper/main.cpp:55: undefined reference to `dhEnumNextObject'debug/main.o:Q:\Darbai\c++\qt_dispHelper/disphelper.h:586: undefined reference to `dhFormatExceptionA'debug/main.o:Q:\Darbai\c++\qt_dispHelper/disphelper.h:473: undefined reference to `SysFreeString@4'collect2: ld returned 1 exit status