News:

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

Can masm still assemble OMF objects? (for lib's)

Started by Brett Kuntz, April 02, 2005, 04:36:48 AM

Previous topic - Next topic

Brett Kuntz

I'm trying to make a library that'll work in Borland (OMF and not MS-COFF). There doesn't seem to be any command line switches for OMF anymore? Or am I missing something?

test.obj : warning LNK4033: converting object format from OMF to COFF

I don't know if the assembler or the linker needs the switch, but both seem to have none at all, and an older version of ml used to have /omf and /coff switches.

Tedd

If you leave out the "/COFF" parameter then ML will output an OMF object.
The problem is encouraging LINK to co-operate :lol (It expects a COFF object)
But shouldn't you be using the borland linker anyway?
No snowflake in an avalanche feels responsible.

Vortex

Hi kunt0r,

All what you need to do is :

ml /c sourcefile.asm

This command launches only the assembler ml.exe

Brett Kuntz

I figured out that much already, I just don't know how to link it up into a lib. I've got Borland installed, but it's linker doesn't seem to be able to link lib's, it has no switch to specify I want a lib =[

I've tried a bunch of linkers I've downloaded and ever a few different coff2omf.exe type tools, nothing works.

Vortex

Hi kunt0r,

Try the librarian of Digital Mars, it creates static libraries from OMF object files.

Brett Kuntz

Yes but it's also $15 and that's money I'm not spending.

I thik the issue (at this time) might be ml making an object file changing my names into one's that start off with a _ and end in @param

ie: If I had a function called "myAdd, :dword, :dword" in the Obj, and then in the resulting .lib it's called:

_myAdd@8

and it needs to be called just "myAdd". I looked through the fpu libs and some tutorial lib's, and they output obj/lib files without the leading underscore and @ sign.

Brett Kuntz

Ah I got it to work now, and have a working console app which uses a lib function. Now for my next question, how do I make a function get included inline with the code and not OOL?

Vortex

QuoteYes but it's also $15 and that's money I'm not spending.

Hi kunt0r,

You don't have to pay for the compiler package containing the librarian and the other necessary tools.
The Digital Mars C/C++ package is free to download:

ftp://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm842c.zip

http://digitalmars.com/download/freecompiler.html

After unzipping the zip file, check the bin folder to use the librarian lib.exe

Brett Kuntz

Yup I ended up using tlib.exe after reading hte borland help file as it explained a few more switches that the actuall exe /? didn't have listed. I'll write up a little walkthrough on how I ended up getting it to work just incase anyone in the future needs the same info, save them a few hours worth of reading/research lol.

Anyways, how do I go about making an inline library function and not an out-of-line one? Out of line is pretty much the same as just making a dynamic DLL however you gotta put more effort into it. Inline would be very nice to make.