You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linker step for execution is a manual step we do just for giggles in case it can actually execute, but there's no real way to convey the intent to link to a library from the frontend.
Although, maybe we could do it by using the library selection.
Greetings,
It'd be nice to add libc
-lc
to the assemblers, such as NASM, so that examples such as this might link printf and do other useful things.Cheers,
Joe
Full link example:
https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:assembly,selection:(endColumn:12,endLineNumber:20,positionColumn:12,positionLineNumber:20,selectionStartColumn:12,selectionStartLineNumber:20,startColumn:12,startLineNumber:20),source:'extern+printf%0A%0Aglobal+_start%0A%0Asection+.data%0A++++message+db+%22Hello+World!!%22,+10,+0%0A%0Asection+.text%0A%0A_start:%0A%0A++++%3B+print+message%0A++++push+dword+message%0A++++call+printf+%0A++++add+esp,+4+%0A%0A++++%3B+exit+with+code+0%0A++++mov+eax,1%0A++++mov+ebx,0%0A++++int+80h'),l:'5',n:'0',o:'Assembly+source+%231',t:'0')),k:44.05904059040591,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:output,i:(compilerName:'x86-64+gcc+12.1',editorid:1,fontScale:14,fontUsePx:'0',j:1,wrap:'1'),l:'5',n:'0',o:'Output+of+NASM+2.14.02+(Compiler+%231)',t:'0'),(h:compiler,i:(compiler:nasm21402,filters:(b:'0',binary:'0',commentOnly:'0',demangle:'0',directives:'0',execute:'0',intel:'0',libraryCode:'0',trim:'1'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:assembly,libs:!(),options:'-lc',selection:(endColumn:23,endLineNumber:3,positionColumn:23,positionLineNumber:3,selectionStartColumn:23,selectionStartLineNumber:3,startColumn:23,startLineNumber:3),source:1,tree:'1'),l:'5',n:'0',o:'NASM+2.14.02+(Assembly,+Editor+%231,+Compiler+%231)',t:'0')),k:55.94095940959409,l:'4',n:'0',o:'',s:1,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4
The text was updated successfully, but these errors were encountered: