#1
|
|||
|
|||
How to fix these three RadASM compile errors?
I'm working on an asm file, now seems only 3 errors, I don't understand it, anyone can give help? Many thanks.
K:\testasm\_tolower.asm(18) : error A2008: syntax error : _SYSTEM_INFO K:\testasm\_tolower.asm(38) : error A2008: syntax error : type K:\testasm\_tolower.asm(498) : error A2081: missing operand after unary operator |
#2
|
|||
|
|||
First Error:
first field of _SYSTEM_INFO struc cannot refer itself. In Windows it is an union union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; }; }; but you can replace the line anonymous_0 _SYSTEM_INFO::$1593C2ABA4C275C0FBEC2498FA3B0937 ? with dwOemId dd ? without problems Second and third error: "Type" name is a reserved word: simply replace it with _Type, for example Best regards, bilbo |
#3
|
|||
|
|||
Quote:
After generate the .obj file and do LINK with VC, it reports errors below, any lib file I need add when do LINK? ; Imports from KERNEL32.dll ; HMODULE __stdcall GetModuleHandleA(LPCSTR lpModuleName) externdef GetModuleHandleA:dword error LNK2019: Unresolved external symbol _GetModuleHandleA ...... error LNK2019: Unresolved external symbol _LeaveCriticalSection |
#4
|
|||
|
|||
you should link with kernel32.lib
|
#5
|
|||
|
|||
But I have used it already, still get this error.
Below is the options I used: LINK /nologo /NODEFAULTLIB /OPT:NOREF /out:test.exe test.obj lmgr.lib libsb.lib libcrvs.lib .\activation\lib\libnoact.lib oldnames.lib kernel32.lib user32.lib netapi32.lib advapi32.lib gdi32.lib comdlg32.lib comctl32.lib wsock32.lib libcmt.lib _tolower.obj |
#6
|
|||
|
|||
you need to set environment variable or include path for those libs in link parameters /LIBPATH, IIRC
|
#7
|
|||
|
|||
Quote:
I do the VC setting as below, is this enough or still something missing? Thank you for your help on check. @set MYPATH=C:\Program Files\VC2008 @set PATH=%MYPATH%\bin @set INCLUDE=%MYPATH%\include;%MYPATH%\PlatformSDK\Include;%MYPATH%\atlmfc\include;%MYPATH%\DirectX_SDK\Include; @set LIB=%MYPATH%\lib;%MYPATH%\PlatformSDK\Lib;%MYPATH%\atlmfc\lib;%MYPATH%\DirectX_SDK\Lib\x86; |
#8
|
|||
|
|||
kernel32.lib does not export GetModuleHandleA, but _imp__GetModuleHandleA
So you need to replace Code:
externdef GetModuleHandleA:dword Code:
pr1 typedef PROTO :DWORD externdef _imp__GetModuleHandleA@4:PTR pr1 GetModuleHandleA equ <_imp__GetModuleHandleA@4> bilbo |
#9
|
|||
|
|||
Quote:
|
#10
|
|||
|
|||
May I ask one more question, here "@4" mean ? Sorry, I'm newbie on this.
Last edited by bridgeic; 04-03-2013 at 14:36. |
#11
|
|||
|
|||
Hi Bilbo,
Seems I can't simply copy/paste and just rename the function name as solution for other Unresolved external symbols. I modify GetLastError as below, but don't works. pr2 typedef PROTO £ºDWORD externdef _imp__GetLastError@4:PTR pr2 GetLastError equ <_imp__GetLastError@4> Is there easy way can work it out for all Unresolved external symbols below? _GetLastError _MultiByteToWideChar _WideCharToMultiByte _GetCurrentProcess _VirtualAlloc _VirtualFree _SetLastError _WriteFile _GetModuleFileNameA _GetSystemInfo _VirtualProtect _GetCPInfo _GetLocaleInfoA _VirtualQuery _InterlockedExchange _InitializeCriticalSection _GetStringTypeW _GetStringTypeA _LoadLibraryA _GetProcAddress _GetStdHandle _GetCurrentThreadId _LCMapStringW _LCMapStringA _ExitProcess _TerminateProcess _HeapReAlloc _HeapAlloc _HeapFree |
#12
|
|||
|
|||
Quote:
Quote:
Quote:
ms_exc = CPPEH_RECORD ptr -18h in _tolower.asm? Best regards bilbo |
#13
|
|||
|
|||
Quote:
Quote:
Quote:
Many many thanks, bilbo, you help me a lots, very appreciated. |
#14
|
|||
|
|||
Hi
Radasm set standart the environment variable or include path You must only add in the source include the Lib Include kernel32.inc Includelib kernel32.lib Or use a macro called "uselib" uselib kernel,gdi32,..... |
#15
|
|||
|
|||
Quote:
I have done that way, but seems doesn't work, would you give more suggestion whether others need check? Thanks. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile eror | rcer | General Discussion | 8 | 06-25-2013 18:21 |
Why this error report in RadASM? | bridgeic | General Discussion | 3 | 04-02-2013 17:36 |