News:

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

Static Lib problem

Started by ecube, November 10, 2006, 09:05:42 AM

Previous topic - Next topic

ecube

I wrote a static lib in asm that uses a great deal of API functions so it isn't compiling currently in a c++ project of mine, since the c++ project uses some of the same api functions, anyone know how to make this work? Am working with visual studio 6.0 because I don't like 2005.

hutch--

Cube,

You should only need to include the libraries that are called in the asm modules in you C program.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

drizz

you must tell the compiler that the names in your library are not mangled.
so your prototypes must look like this:


/* header file for my library */
#ifdef __cplusplus
extern "C" {
#endif
DWORD __stdcall MyUberAsmFuncInMyAsmLib ( DWORD );
__stdcall MyUberAsmFuncInMyAsmLib2 ( BYTE * );
BYTE * __cdecl MyUberAsmFuncInMyAsmLib3 ( ... );
#ifdef __cplusplus
}
#endif

The truth cannot be learned ... it can only be recognized.

ecube

Thankyou hutch--,
I find that amazing how easy that is, great :)

Jackey

Quote from: drizz on November 10, 2006, 11:29:55 AM
you must tell the compiler that the names in your library are not mangled.
so your prototypes must look like this:


/* header file for my library */
#ifdef __cplusplus
extern "C" {
#endif
DWORD __stdcall MyUberAsmFuncInMyAsmLib ( DWORD );
__stdcall MyUberAsmFuncInMyAsmLib2 ( BYTE * );
BYTE * __cdecl MyUberAsmFuncInMyAsmLib3 ( ... );
#ifdef __cplusplus
}
#endif



thanks ;)