News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

help about including C lib files

Started by Michael, April 08, 2014, 01:56:50 AM

Previous topic - Next topic

Michael

hello all,
i wonder if it's possible to include a C lib file in MASM.
currently i have a C lib file which require uuid.lib oldnames.lib libc.lib
i tried copying these lib files from VC6.0 into my MASM project folder. but MASM couldn't compile my asm file, reporting dozens of "unresolved external symbol"
what can i do?

Gunther

Hi Michael,

Quote from: Michael on April 08, 2014, 01:56:50 AM
hello all,
i wonder if it's possible to include a C lib file in MASM.
currently i have a C lib file which require uuid.lib oldnames.lib libc.lib
i tried copying these lib files from VC6.0 into my MASM project folder. but MASM couldn't compile my asm file, reporting dozens of "unresolved external symbol"
what can i do?
I'm not sure if I understand your question right. But a library (lib file) is a number of different object files. You have to import the correct names (attention: often case sensitive) of the procedures you want to use (call). These are the "unresolved external symbols".

Please have a look into the examples section of MASM32. There are a lot of examples which show the apropriate import of external symbols.

Welcome to the forum.

Gunther
You have to know the facts before you can distort them.

dedndave

also.....

the names are very likely decorated
in the masm32 package, Hutch has created an INC file for MSVCRT (masm32\include\msvcrt.inc)
you might be interested to have a look at that

it's not, strictly speaking, the best example, because MsVcrtxx.dll is a runtime library
but, you will see some decorated names, nonetheless

Erol (Vortex) is one guy that may be able to help you out   :t
he probably has tools that will help

http://vortex.masmcode.com/

"MS COFF Object file undecorator V1.1"

qWord

Quote from: Michael on April 08, 2014, 01:56:50 AMcurrently i have a C lib file which require uuid.lib oldnames.lib libc.lib
i tried copying these lib files from VC6.0 into my MASM project folder.
Instead of copying the libs you should specify the VC library directory when linking (option /LIBPATH:"C:\xyz\VC\lib").
MREAL macros - when you need floating point arithmetic while assembling!

ragdog


Vortex

Hi Michael,

Welcome to the forum.

Did you specify correctly the C function prototypes?

Michael

thank you all. i added below lines in my asm file and now it works.

includelib   \masm32\lib\hid.lib
includelib   \vc\lib\kernel32.lib
includelib   \vc\lib\setupapi.lib
includelib   \vc\lib\msvcrt.lib
includelib   \vc\lib\uuid.lib
includelib   \vc\lib\oldnames.lib
includelib   \vc\lib\libc.lib

i found that the libc.lib kernel32.lib msvcrt.lib files in masm32 didn't work in this case, while the ones in vc folder work.