How to fix these three RadASM compile errors?
1 Attachment(s)
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 |
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 |
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 |
you should link with kernel32.lib
|
Quote:
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 |
you need to set environment variable or include path for those libs in link parameters /LIBPATH, IIRC
|
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; |
kernel32.lib does not export GetModuleHandleA, but _imp__GetModuleHandleA
So you need to replace Code:
externdef GetModuleHandleA:dword Code:
pr1 typedef PROTO :DWORD bilbo |
Quote:
|
Quote:
|
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 |
Quote:
Quote:
Quote:
ms_exc = CPPEH_RECORD ptr -18h in _tolower.asm? Best regards bilbo |
Quote:
Quote:
Quote:
Many many thanks, bilbo, you help me a lots, very appreciated. :) |
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,..... |
Quote:
I have done that way, but seems doesn't work, would you give more suggestion whether others need check? Thanks. |
All times are GMT +8. The time now is 06:24. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX