I tried to link a object file (written in asm, compiled by tasm32) with another object file (written in cpp, compiled by vc 6.0++) by link program of vc6.0++ package. But I failed.
Is there another way to link object files (written in different language, for example: vc6.0++, bc5, masm32, tasm32, ...)? If you know, please tell me!
Thanks a lot.
Is there another way to link object files (written in different language, for example: vc6.0++, bc5, masm32, tasm32, ...)? If you know, please tell me!
Thanks a lot.
TASM generates an OMF-type object file.
VC generates a COFF one.
You can get COFF2OMF, it comes with the Digital Mars C++ compiler, I believe.
VC generates a COFF one.
You can get COFF2OMF, it comes with the Digital Mars C++ compiler, I believe.
vkdt,
Try to match the assembler you use to the C compiler you use, for Microsoft C/C++ use MASM, for Borland use TASM, I think some of the GPL C compilers can use either NASM or GAS.
The problem you will probably have when trying to mix them is the object file format and while you may finds a converter, it is a lot safer to use the correct assembler for the compiler.
Regards,
hutch@movsd.com
Try to match the assembler you use to the C compiler you use, for Microsoft C/C++ use MASM, for Borland use TASM, I think some of the GPL C compilers can use either NASM or GAS.
The problem you will probably have when trying to mix them is the object file format and while you may finds a converter, it is a lot safer to use the correct assembler for the compiler.
Regards,
hutch@movsd.com
The VC linker is capable of linking OMF files. The problem will typically be the actual link names used.
I am assuming you used FLAT memory model, or all your segments are USE32.
When calling extern "C" functions, VC will prepend with "_" and append with "@n" where n is the number of argument bytes (so it's always a multiple of 4).
If you only extern a function, you will get the VC++ name mangling used to simulate type checking at link time.
I am assuming you used FLAT memory model, or all your segments are USE32.
When calling extern "C" functions, VC will prepend with "_" and append with "@n" where n is the number of argument bytes (so it's always a multiple of 4).
If you only extern a function, you will get the VC++ name mangling used to simulate type checking at link time.