|
|
Home » Developing U++ » UppHub » sysinfo gets error
|
|
Re: sysinfo gets error [message #32554 is a reply to message #32551] |
Tue, 24 May 2011 17:58   |
silverx
Messages: 62 Registered: March 2011
|
Member |
|
|
I decided to strip down the code in sysinfo, and go after only the pieces of information that I really want, so I wrote a small program, but I get a link error when I try and run it.
My code is a simple window with a push button on it to execute the code.
The main code is as follows which is copied directly from the sysinfo demo:
#include "mysysinfo1.h"
using namespace Upp;
#include <SysInfo/SysInfo.h>
static bool end = false;
void mysysinfo1::Gettheinfo()
{
String manufacturer, productName, version, mbSerial;
Date releaseDate;
int numberOfProcessors;
GetSystemInfo(manufacturer, productName, version, numberOfProcessors, mbSerial);
// romptOK("Hello world");
PromptOK(mbSerial);
PromptOK(GetDesktopFolder());
}
mysysinfo1::mysysinfo1()
{
CtrlLayout(*this, "My System Information program");
// add below for using a button
btnDoSomething <<= THISBACK(Gettheinfo);
}
GUI_APP_MAIN
{
mysysinfo1().Run();
}
And the error that I am getting on it is
----- CtrlLib ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (1 / 9)
----- CtrlCore ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (2 / 9)
----- Draw ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (3 / 9)
----- plugin/bmp ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (4 / 9)
----- RichText ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (5 / 9)
----- Core ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (6 / 9)
----- plugin/z ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (7 / 9)
----- plugin/png ( GUI SSE2 MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (8 / 9)
----- mysysinfo1 ( GUI SSE2 MAIN MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (9 / 9)
main.cpp
mysysinfo1: 1 file(s) built in (0:03.10), 3105 msecs / file, duration = 3120 msecs, parallelization 0%
Linking...
main.obj : error LNK2019: unresolved external symbol "void __cdecl GetSystemInfo(class Upp::String &,class Upp::String &,class Up
p::String &,int &,class Upp::String &)" (?GetSystemInfo@@YAXAAVString@Upp" target="_blank">>@Upp@@00AAH0@Z" target="_blank">>@Z) referenced in function "public: void __t
hiscall mysysinfo1::Gettheinfo(void)" (?Gettheinfo@mysysinfo1@@QAEXXZ)
C:\upp\out\MSC9.Debug.Debug_full.Gui.Sse2\mysysinfo1.exe : fatal error LNK1120: 1 unresolved externals
There were errors. (0:03.65)
|
|
|
|
Re: sysinfo gets error [message #32568 is a reply to message #32559] |
Wed, 25 May 2011 10:01   |
|
koldo wrote on Tue, 24 May 2011 23:36 | Hello SilverX
If I understand well you are not using SysInfo package, but as you use GetSystemInfo(), linker complains because he does not find this SysInfo function.
|
I tried to compile sysinfo_demo_gui on my windows xp 32 bit SP3. It compiles well but on startup get the following error:
Quote: |
the procedure entry point K32GetModuleBaseNameW could not be located in the dynamic link library KERNEL32.dll
|
|
|
|
|
|
|
|
|
Re: sysinfo gets error [message #32636 is a reply to message #32634] |
Mon, 30 May 2011 16:17   |
|
koldo wrote on Mon, 30 May 2011 15:14 | Hello Tojocky and SilverX
I will upload the change today. It is just to add this compiler option for MSC: /D PSAPI_VERSION=1
This way both v6.1 and v7.0 Microsoft SDKs can be used 
|
according by:
Quote: |
For performance reasons, some APIs have been moved from Psapi.dll to Kernel32.dll in Windows7 and Windows Server 2008 R2. WinSDK v7.0* is reflecting these modifications to be compatible with the new system dlls.
|
from:
http://blogs.msdn.com/b/vcblog/archive/2009/08/27/windows-sd k-v7-0-v7-0a-incompatibility-workaround.aspx
This solution is a dis-optimization for windows 7 and Server 2008.
|
|
|
|
|
|
Re: sysinfo gets error [message #34710 is a reply to message #34709] |
Tue, 06 December 2011 23:54   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Hi Koldo,
My package organiser looks the same as yours. I guess your options come across automatically.
The errors I get look like this
C:\upp\bazaar\Functions4U/Functions4U.h(26) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(26) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(26) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(84) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(84) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(85) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(85) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(96) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(96) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(118) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(118) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(118) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(120) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(120) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(120) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(124) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(124) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(124) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(122) : error C2065: 'length' : undeclared identifier
C:\upp\bazaar\Functions4U/Functions4U.h(126) : error C2065: 'length' : undeclared identifier
C:\upp\bazaar\Functions4U/Functions4U.h(126) : error C2065: 'id' : undeclared identifier
C:\upp\bazaar\Functions4U/Functions4U.h(126) : error C2614: 'FileData' : illegal member initialization: 'id' is not a base or member
C:\upp\bazaar\Functions4U/Functions4U.h(126) : error C2614: 'FileData' : illegal member initialization: 'length' is not a base or member
C:\upp\bazaar\Functions4U/Functions4U.h(135) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(135) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(135) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(137) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(137) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(137) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(163) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(163) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(163) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\upp\bazaar\Functions4U/Functions4U.h(178) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(178) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(178) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(186) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(186) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(186) : error C2238: unexpected token(s) preceding ';'
C:\upp\bazaar\Functions4U/Functions4U.h(220) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(220) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(410) : error C2589: '__int64' : illegal token on right side of '::'
C:\upp\bazaar\Functions4U/Functions4U.h(410) : error C2059: syntax error : '::'
C:\upp\bazaar\Functions4U/Functions4U.h(412) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
the top of the header file in which I include SysInfo looks like this
#ifdef flagPRO
#ifndef __CRYPTOGRIX_H__
#define __CRYPTOGRIX_H__
#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>
#include <Web/Web.h>
#include <Web/util.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
using namespace Upp;
#include <SysInfo/SysInfo.h>
thanks for looking at this,
Nick
[Updated on: Tue, 06 December 2011 23:56] Report message to a moderator
|
|
|
Re: sysinfo gets error [message #34712 is a reply to message #34710] |
Wed, 07 December 2011 00:54   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
OK, as could be predicted, its not you it's me
I just built the SysInfo_demo_gui and it works fine. I added my geotiff package to it and it still appears to work fine.
No idea what I am doing wrong in my own software.
Nick
EDIT: OK, the SysInfo package likes to get included first. It is a very important package and so should come straight after
#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>
So now I can compile with MSC10 but not MSC10x64. In MSC10x64 I get
----- SysInfo ( GUI MT OCOE PRO MSC10X64 FORCE_SPEED WIN32 MSC ) (14 / 29)
SysInfo.cpp
C:\upp\bazaar\Functions4U/Functions4U.h(297) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data
C:\upp\bazaar\SysInfo\SysInfo.cpp(646) : error C2065: 'GWL_HINSTANCE' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(660) : warning C4244: 'initializing' : conversion from 'LRESULT' to 'int', possible loss of data
C:\upp\bazaar\SysInfo\SysInfo.cpp(1607) : error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1608) : error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1608) : error C2065: '_emit' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1608) : error C2143: syntax error : missing ';' before 'constant'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1609) : error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1609) : error C2146: syntax error : missing ';' before identifier '_emit'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1609) : error C2065: '_emit' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1609) : error C2143: syntax error : missing ';' before 'constant'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2146: syntax error : missing ';' before identifier 'mov'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2065: 'mov' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2146: syntax error : missing ';' before identifier 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2146: syntax error : missing ';' before identifier 'PTR'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(152) : see declaration of 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2065: 'PTR' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1610) : error C2146: syntax error : missing ';' before identifier 'start'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2065: 'eax' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2146: syntax error : missing ';' before identifier 'mov'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2065: 'mov' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2146: syntax error : missing ';' before identifier 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2146: syntax error : missing ';' before identifier 'PTR'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(152) : see declaration of 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1611) : error C2065: 'PTR' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1612) : error C2065: 'edx' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1612) : error C2143: syntax error : missing ';' before '}'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1616) : error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1617) : error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1617) : error C2065: '_emit' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1617) : error C2143: syntax error : missing ';' before 'constant'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1618) : error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
C:\upp\bazaar\SysInfo\SysInfo.cpp(1618) : error C2146: syntax error : missing ';' before identifier '_emit'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1618) : error C2065: '_emit' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1618) : error C2143: syntax error : missing ';' before 'constant'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2146: syntax error : missing ';' before identifier 'mov'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2065: 'mov' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2146: syntax error : missing ';' before identifier 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2146: syntax error : missing ';' before identifier 'PTR'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(152) : see declaration of 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2065: 'PTR' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1619) : error C2146: syntax error : missing ';' before identifier 'end'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2065: 'eax' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2146: syntax error : missing ';' before identifier 'mov'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2065: 'mov' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2146: syntax error : missing ';' before identifier 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2146: syntax error : missing ';' before identifier 'PTR'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(152) : see declaration of 'DWORD'
C:\upp\bazaar\SysInfo\SysInfo.cpp(1620) : error C2065: 'PTR' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1621) : error C2065: 'edx' : undeclared identifier
C:\upp\bazaar\SysInfo\SysInfo.cpp(1621) : error C2143: syntax error : missing ';' before '}'
Does this mean anything to you?
I also get this with MSC9x64 and I also get it when I compile SysInfo_demo_gui.
I can setup a machine with Windows 7 x64, UPP 4193 and MSC10 and MSC10x64 for you to test on here through remote access if you're up for it. Let me know by email and I can send you the login etc.
Nick
EDIT tried SDKs 6.1, 7.0 and 7.1 all with same result
For now I have had to comment out the bodies of GetWindowsList() and GetCpuSpeed(). I don't need these functions anyway so not a problem for now.
[Updated on: Wed, 07 December 2011 02:12] Report message to a moderator
|
|
|
Re: sysinfo gets error [message #34717 is a reply to message #34712] |
Wed, 07 December 2011 11:09   |
Tom1
Messages: 1302 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Nick,
I'm not a specialist on the SysInfo, but I do know that 64-bit MSC simply does not support inline assembly. You see those "'_asm' keyword not supported on this architecture". So, I think those inline assembly parts are not going to work without rewriting the code without inline assembly.
Best regards,
Tom
|
|
|
|
Re: sysinfo gets error [message #34721 is a reply to message #34718] |
Thu, 08 December 2011 12:18   |
Tom1
Messages: 1302 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Koldo,
I think your fixes work just fine. I just updated SysInfo_demo_gui from Bazaar and it compiles just fine with MSC9, MSC9x64, MSC10 and MSC10x64.
I noticed though that the following is missing/zero on the System Info page:
- Bios serial
- MotherBoard serial
- Temperature
- Remaining battery capacity
Additionally, in 64 bit version the CPU Speed remains at 0.001 GHz, whereas it should in fact show 2.83 GHz.
Having the MotherBoard and Bios serial numbers work would be really nice, since these could potentially be used as 'dongles' with mdelfede's Protect package.
Best regards,
Tom
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 19:51:39 CEST 2025
Total time taken to generate the page: 0.01329 seconds
|
|
|