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.
Posted on 2002-10-26 05:10:35 by vkdt
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.
Posted on 2002-10-26 06:21:25 by death

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.


Posted on 2002-10-26 08:27:09 by hutch--
Maybe this link will help.

Posted on 2002-10-26 18:12:46 by minimoog
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.
Posted on 2002-10-30 11:08:52 by tenkey