A
A
Alexander Taratin2014-08-19 18:05:17
C++ / C#
Alexander Taratin, 2014-08-19 18:05:17

MinGW. How to use WMI?

I just can not find information on how to connect WMI on windows mingw.
I am writing in Qt. I add to the project

LIBS += "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/WbemUuid.Lib"
LIBS += -lwbemuuid

in headers
#include <comdef.h>
#include <Wbemidl.h>
#pragma comment(lib, "wbemuuid.lib")

The compiler works, but the linker no longer finds the necessary functions.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2014-08-23
@Taraflex

In short, the answer to the question is no.
Moved to MSVC.

E
EXL, 2014-08-20
@EXL

I'm not entirely sure that a C++ library compiled in MSVC can be slipped into MinGW. Read this:
stackoverflow.com/questions/7064160/using-msvc-lib...
www.mingw.org/wiki/Interoperability_of_Libraries_C...
mingw.5.n7.nabble.com/using-VC-lib-with-mingw -td19...
I don't know what WMI is, but suddenly in your case everything will be solved by wrapping the header inextern "C"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question