If an api within an ".asm" file makes the linker(tasm linker) send an error for external unresolved, would that be an error within the asm or inc files or because the import library doesn't have the api under kernel32: lstrlen api. My import library is dated from 1996. If it's the import library short coming how do I solve that for tasm32. Please be specific as I'm a newbie.

(sorry NaN, hope this post isn't against the rules. Oh please delete the previous thread if possible Thanks. I wish to learn asm programing but the books are very few and the compilers/assemblers are not that compatible with each other to just use another assembler.)
Posted on 2002-05-18 15:11:50 by BeHereNow
have you included both the kernel inc and lib file.
Posted on 2002-05-18 15:46:57 by Kudos
I have an import library for tasm32. It didn't have a kernel.inc in the folder. Is that a command I have to put in the .asm file like:
include kernel.inc
or is it a file I generate from windows(if so how do I do that) or download somewhere. or is it to be included in the .inc file? what would be the proper way to list it there?
Thanks for taking the time to read and answer the question.
Posted on 2002-05-18 15:53:43 by BeHereNow
What does it mean? My understanding is that this is a code line that cannot function or be implemented either due to not being in the .inc file and/or has no reference in the import library.
Am I understanding it correctly?
Posted on 2002-05-18 16:02:28 by BeHereNow
the inc file would be included by your asm file. Maybe you have a different inc file, it dosen't realy matter what the inc file's name is as long as it contains the prototypes for the functions. usually you have one inc and one lib file for every library you want to link to.
Posted on 2002-05-18 16:05:15 by Kudos
it means you are using a function that the assembler can't find.
Posted on 2002-05-18 16:07:06 by Kudos
I do have an .inc , .asm , .rc , .res , and I managed to get an .obj file from "make.exe".
My .exe that's generated is being deleted by my linker.exe because of unresolved function, that is included in the .inc file and the .asm file.
My thought is since the "make.exe" is generating an .obj file then probably the .asm file is fine. This leaves the .inc file to probably not having the proper declaration or the declaration is not having a way to be linked with the import library because it's not there.
Why? Because the api function is from windoz 95 and above, while the library is old so most likely it doesn't list this api(mine doesn't because I looked for it, but it might not have to be listed there. That's why I'm here asking this question).
Thanks again and I hope I clarified my question.
BTW the api's are:
lstrlenA
wsprintfA

They are both included in the .asm file as follow:

include xxxx.inc
extrn _wsprintfA:proc
extrn _lstrlenA:proc
fmat db "%lu",0

and included in the .inc file as follow:

lstrlenA PROCDESC WINAPI :LPCSTR

I didn't know how to list wsprintf there.

Thanks again.
Posted on 2002-05-18 16:22:39 by BeHereNow
I think that the problem is that your not linking to the lib file. I use masm and that uses includelib xxx.lib but I'm sure tasm has a similar command.
Posted on 2002-05-18 16:27:49 by Kudos
I'll check the code to see if I link to the .lib file or not.
Posted on 2002-05-18 16:32:12 by BeHereNow
The API functions in the TASM lib file do not start with "_". You should be linking to lstrlenA, not _lstrlenA.
Posted on 2002-05-18 17:01:12 by tenkey
Thanks tenkey and Kudos. I deleted the _ like you said. I also deleted the
"extrn _wsprintfA:proc" line from the asm file and it did compile fine.However the program causes a fault when executed and it doesn't run, but this is another problem that I have to look into. I also downloaded an updated import32.lib file that has much more functions listed(but that alone didn't solve the problem). Thank you again and happy assembling.
Posted on 2002-05-18 17:32:49 by BeHereNow
You are coding under TASM, so you tried this?

Note Unlike other Windows functions, wsprintf uses the C calling convention (_cdecl), rather than the Pascal calling convention. As a result, it is the responsibility of the calling process to pop arguments off the stack, and arguments are pushed on the stack from right to left. In C-language modules, the C compiler performs this task.


"invoke" (MASM) pop argumentos off the stack automatically ... while "call" (TASM) not ...
Posted on 2002-05-18 18:27:19 by hunter
I believe I did that. I think the code needs to be worked on for a little longer and I would have liked to use masm32 but the code doesn't transfer well between tasm and masm, so I just want to finish this program and then move to masm in other projects. Any tutorials on converting code between assemblers? BTW this is my very first programming experience ever and asm isn't the easiest to start with but I think it's very compact and offers better control of the compiling process(with it's own drawbacks like having to put in the right code). :)
Oh well I might do a little debugging to see where it crashes, and then I might have a clue on what I did wrong.
Cheers.
Posted on 2002-05-18 20:05:59 by BeHereNow
BeHereNow,

I am getting a bit rusty with TASM as I have not used it for years bit if you have the installation disks and installed it completely, it has a set of utilities for creating import libraries from existing DLLs so you can make your own.

With new projects, working with MASM will be a lot easier as it is a later assembler that has a lot more support available, help files, accessories etc ...

Regards & good luck with your project.

hutch@movsd.com
Posted on 2002-05-18 20:33:19 by hutch--
I finally got it running. I had to do it through Masm32 instead of Tasm because like Hutch said it's much better supported and I relied on examples to get my program running. I did find the utilty in tasm for making import library but somehow I ended up with smaller lib file than the ones included with tasm. Thanks again.
Posted on 2002-05-24 15:05:32 by BeHereNow