I'm trying to use Unicode in addition to ANSI routines; I've got proper routineW protos defined, yet the linker tells me "unresolved external symbol _routineW@8". Will someone please explain more about lib files so I can get past this block?

Regards,
Posted on 2002-09-29 11:49:00 by belairdino
belairdino,

The include files in MASM32 are ANSI form as that is where the most demend is so if you want to use UNICODE functions from the APIs, write yourself a seperate include file that has the prototypes for the functions you require. Do not use the equates that are already used with the MASM32 includes as you will get an error when building.

Just be careful with the target OS you have in mind as win95/98 do not support UNICODE from memory.

Regards,

hutch@movsd.com
Posted on 2002-09-30 06:58:42 by hutch--
hutch,

Thanks for the reply, I'm running Windows XP (writing for the NT or later platforms), so I understand that 9x won't run my stuff.

Turns out the problem was a typo; I had incorrectly spelled routineW but had the hardest time seeing the mistake.

The good news is:

1) It now works!
2) I discovered by running dumpbin against shell32.lib, that VStudio has interjected an older version of several .lib files into my path; I already had specified /LIBPATH in my MAK file, so I think I'm picking up the correct lib now. Also learned about /VERBOSE; very handy.

I think I'm up and running now; just needed to see the problem from a different angle.

When I build my own .dll, I see the .lib file also has these mangled names. Where can I turn to learn more about the mangling and embellishment of routine names?

Sorry for the basic linker questions; I'm coming from an S/390 assembler background with several years VisualBasic thrown in for good measure.
Posted on 2002-09-30 09:35:25 by belairdino
My C is getting rustier by the day but from memory if you are going to use MASM modules or libraries in C/C++ code, you need to surround the prototypes with EXTERN C style declarations. Your documentation for the C compiler should have this syntax available.

If the primary language for your DLL is C/C++, you would use the linker from the C compiler and make sure the assembler modules has a prototype written in C. If the main language is assembler, I would use the linker from MASM32 as it has smaller alignment and the build size will be smaller. You will of course need to write the C function prototypes in assembler to use them.

Regards,

hutch@movsd.com
Posted on 2002-09-30 10:00:48 by hutch--
Thanks, hutch--, but I'm no C or C++ person either (too many squiggly things). I'm just working in assembler for now, trying to drive Windows from the machine level.

I rediscovered some old Win32ASM doc I'd picked up along the way, which better described the 'decoration' of entry points; apparently that is a Windows/C method which MASM needs to replicate. Also it looks like the assembler and linker take care of it for me.

Moving along now on my merry way...
Posted on 2002-10-01 08:42:35 by belairdino