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.
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?
Hi kunt0r,
All what you need to do is :
ml /c sourcefile.asm
This command launches only the assembler ml.exe
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.
Hi kunt0r,
Try the librarian of Digital Mars, it creates static libraries from OMF object files.
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.
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?
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
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.