News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Symbols not defined

Started by pro3carp3, May 08, 2009, 03:29:32 AM

Previous topic - Next topic

pro3carp3

I've been away from assembler for quite some time and am setting up GoAsm to work with RadASM.  When I run the linker from RadASM on a simple console program, I get the following error:

The following symbols were not defined in the object file or files:-
WriteConsole
ReadConsole

GetStdHandle is recognized, but not these two.  RadASM recognizes them but the linker does not.   What file am I missing?

Thanks.

LGC
LGC

jorgon

Hi pro3carp3

Welcome to the forum and to the "Go" tools (except that RadASM is a 3rd party product).

The message you have got is from GoLink, the linker.

If you look in Microsoft's Platform SDK, you will see that the APIs WriteConsole and ReadConsole are within the system file Kernel32.dll

When you build your program, the linker is called and it looks inside any DLL that it has been told to look into, for any symbols not yet found.
So the error could be one or both of the following:-

1. Not informing the linker to look at Kernel32.dll. You need to tell RadASM to tell the linker to do this.

2. Also you need to bear in mind that WriteConsole and ReadConsole as APIs do not actually exist.  They are actually WriteConsoleA ReadConsoleA, and WriteConsoleW  ReadConsoleW depending on whether you are calling the ANSI or Unicode versions.  I believe, in RadASM, there is an include file (or header file) which automatically switches to find the correct name for you.  If this file is not included in your source then this won't happen and you will get the same message.  Alternatively you can change the name manually.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

pro3carp3

Thank you, jorgon.

I do remember now that there was an include file that mapped the generic API name to the desired API form, ANSI or unicode.  Do you know where I can find it?  I don't recall where I got it from or what it was called.

If I use the actual API name (ReadConsoleA), it will compile &l link, but I lose the parameter declarations help in RadASM.

Thanks.
LGC

Mark Jones

Hi, welcome back. Arguably, the "de-facto standard" in GoASM headers has recently been updated, and may be considerably different than what you were using before. Please see Edgar's webpage for the .zip file under "GoAsm headers":

http://www.quickersoft.com/donkey/

To use these headers, do three things:
1. Extract the header files into a folder (such as "c:\GoASM\include\")
2. Create/set/append to an environment variable called "INCLUDE", the path above i.e. "c:\GoASM\include"
3. Place the following at the top of the source file:


#DEFINE WIN32_LEAN_AND_MEAN
#DEFINE LINKFILES
#INCLUDE <windows.h>


This will probably get you up and running, just let us know if something else misbehaves.

Note, it might be helpful to try assembling and linking from the command-line first, to make sure the package is working properly, then try a RadASM project. Combining multiple unknowns is the root of all evil. :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

pro3carp3

Mark:

That's exactly what I needed.  Thank you.
LGC