The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: pro3carp3 on May 08, 2009, 03:29:32 AM

Title: Symbols not defined
Post by: pro3carp3 on May 08, 2009, 03:29:32 AM
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
Title: Re: Symbols not defined
Post by: jorgon on May 08, 2009, 06:47:22 AM
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.

Title: Re: Symbols not defined
Post by: pro3carp3 on May 08, 2009, 01:09:22 PM
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.
Title: Re: Symbols not defined
Post by: Mark Jones on May 08, 2009, 02:32:38 PM
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 (http://support.microsoft.com/default.aspx?scid=kb;en-us;310519) 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
Title: Re: Symbols not defined
Post by: pro3carp3 on May 11, 2009, 01:26:22 AM
Mark:

That's exactly what I needed.  Thank you.