bflattened / bflat

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)
GNU Affero General Public License v3.0
3.56k stars 102 forks source link

How to link the object files to get the final binary? #102

Closed 2dpdlja496or43iq closed 1 year ago

2dpdlja496or43iq commented 1 year ago

I don't know which command to use. I'm compiling the makefile style, this means compiling to object files first then linked everything together to make the final binary. Please help. Thank you.

MichalStrehovsky commented 1 year ago

Building into an object file only makes sense if you want to do something special with it. It's not possible to build several assemblies into object files and then link them into a single executable if that's what you want to do. Compile to IL assemblies instead and pass them all to bflat build in a single invocation.

FrankRay78 commented 3 months ago

nb. Lack of compiling/linking multiple individual native obj files, perhaps some that exist outside of the C# solution, was the reason I could not use bflat as the single build tool chain for my C# native kernel/OS. This is because the native boot loader (written in assembly and compiled to an unlinked object) needed to be then linked to the main C# kernel object file(s).