Thomas-Sparber / wmi

Very simple C++ library to query WMI (even for MinGW)
Other
91 stars 24 forks source link

C2511 error #23

Closed Adrianotiger closed 2 years ago

Adrianotiger commented 2 years ago

The last branch was merged without testing it. You can't create a new function without declaring it in the header file:

https://github.com/Thomas-Sparber/wmi/blob/ff1687bd95d77bfbcb3744576801d42a25d3e30f/src/wmiresult.cpp#L157

and:

https://github.com/Thomas-Sparber/wmi/blob/ff1687bd95d77bfbcb3744576801d42a25d3e30f/src/wmiresult.cpp#L275

2 new overloaded methods was added (with uint8_t) but they are missing in the header file.

Thomas-Sparber commented 2 years ago

Hi Adriano, thanks a lot for your feedback! It's now fixed. Please test and let me know. Best Regards Thomas

Adrianotiger commented 2 years ago

Hi Thomas. It was really fast :)

Yes it now works and compile without errors.

I am still trying the lib, but I can't integrate it in my test project:

wmi.lib(wmi.cpp.obj) : error LNK2001: unresolved external symbol "IID_IWbemLocator". wmi.lib(wmi.cpp.obj) : error LNK2001: unresolved external symbol "CLSID_WbemLocator".

I can't include "WbemCli.h" in my project as this will give me other errors ("byte" is redefined in this header file).

But this is more offtopic.

Thomas-Sparber commented 2 years ago

Hmm yes this seems a bit offtopic - at least not directly related to the lib...

Some thoughts:

Adrianotiger commented 2 years ago

After porting it to a VS2019 and checking every single difference, I found why: I have to include wbemuuid.lib in my project.

Hope this can help future users :)

Thomas-Sparber commented 2 years ago

OK great, I'm happy it works now! :-) So will close this issue