Home » Developing U++ » UppHub » SysInfo - linking fail
SysInfo - linking fail [message #49073] |
Thu, 14 December 2017 08:55 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
with latest U++ 11550 and Mingw in a program using Function4U I got the following error
C:\Users\Postazione2\Documents\upp/MyApps/Functions4U/Functi ons4U_Gui.h (40): warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
(): Linking has failed
(): C:/Users/Postazione2/Documents/upp/out/MyApps/SysInfo/MINGWx 64.Gui\SysInfo.a(SysInfo.o):SysInfo.cpp:(.rdata$.refptr.CLSI D_WbemAdministrativeLocator[.refptr.CLSID_WbemAdministrative Locator]+0x0): undefined referen
ce to `CLSID_WbemAdministrativeLocator'
(): collect2.exe: error: ld returned 1 exit status
Any idea how to fix it?
Thanks,
Luigi
[Updated on: Sun, 17 December 2017 21:52] by Moderator Report message to a moderator
|
|
|
|
Re: SysInfo [message #49092 is a reply to message #49091] |
Sat, 16 December 2017 23:11 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
Just small code review of your fix dear Koldo
DWORD /*dwThreadId, */dwProcessId; // This is bad habit to keep commented code in your sources. The commented variable should be removed.
// Just keep
DWORD dwProcessId;
// The same thing here...
/* dwThreadId = */GetWindowThreadProcessId(reinterpret_cast<HWND>(hWnd[i]), &dwProcessId);
// Stay with:
GetWindowThreadProcessId(reinterpret_cast<HWND>(hWnd[i]), &dwProcessId);
// -----------------------------------------------
DWORD state = ::WaitForSingleObject(hProc, timeout);
// Why not auto? You will do not need to remember the type returning by WaitForSIngleObject...
auto state = ::WaitForSingleObject(hProc, timeout);
// -----------------------------------------------
if ((state == WAIT_TIMEOUT) || (state == WAIT_FAILED))
ret = ::TerminateProcess(hProc, 0); // You have space indentation instead of tabs...
// -----------------------------------------------
//bool hdSerialMatch = false; // The same problem with commented code - not used remove it.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 16 December 2017 23:13] Report message to a moderator
|
|
|
Re: SysInfo [message #49095 is a reply to message #49092] |
Sun, 17 December 2017 09:35 |
|
koldo
Messages: 3361 Registered: August 2008
|
Senior Veteran |
|
|
Dear Klugier
Thank you for your review.
Normally in code that has been programed years ago, after finding that something is not interesting, I usually comment this out for a while instead of removing it just if I realize after that it was interesting.
I am not used with the "auto" type. I think it hides the real type "for good and for evil". I mean, you require a little more effort to put DWORD instead of auto, but when you are reviewing the code, you cannot see the hidden details at a glance with an auto. Even in this case I prefer to put DWORD instead of an int.
About spaces instead of tabs, it is probably because of my editor does not distingish spaces and tabs (and if yes, I would disabled this feature). I do prefer tabs, but I do not thing this is interesting.
Best regards
Iñaki
[Updated on: Fri, 29 December 2017 22:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed May 15 04:26:26 CEST 2024
Total time taken to generate the page: 0.02480 seconds
|