Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I link in C object files created with another compiler?

compiler files link object
0
Posted

Can I link in C object files created with another compiler?

0

DMD produces OMF (Microsoft Object Module Format) object files while other compilers such as VC++ produce COFF object files. DMD’s output is designed to work with DMC, the Digital Mars C compiler, which also produces object files in OMF format. The OMF format that DMD uses is a Microsoft defined format based on an earlier Intel designed one. Microsoft at one point decided to abandon it in favor of a Microsoft defined variant on COFF. Using the same object format doesn’t mean that any C library in that format will successfully link and run. There is a lot more compatibility required – such as calling conventions, name mangling, compiler helper functions, and hidden assumptions about the way things work. If DMD produced Microsoft COFF output files, there is still little chance that they would work successfully with object files designed and tested for use with VC. There were a lot of problems with this back when Microsoft’s compilers did generate OMF. Having a different object file forma

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123