PageSourceSearch

https://milkv.io/assets/js/f555c63d.9a9c2fce.js

js milkv.io collected 2026-09-24 19:35:16 UTC 5,318 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmilkv_website=self.webpackChunkmilkv_website||[]).push([[6630],{90180:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var t=i(85893),l=i(11151);const s={sidebar_label:"Using GCC",sidebar_position:5},o="Using GCC",a={id:"jupiter/application-development/gcc",title:"Using GCC",description:"After Jupiter is installed with Ubuntu, Bianbu systems, it supports onboard development. Here, we take the use of GCC to compile a test program as an example to introduce the onboard development method.",source:"@site/docs/jupiter/application-development/gcc.md",sourceDirName:"jupiter/application-development",slug:"/jupiter/application-development/gcc",permalink:"/docs/jupiter/application-development/gcc",draft:!1,unlisted:!1,editUrl:"https://github.com/milk-v/milkv.io/edit/main/docs/jupiter/application-development/gcc.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_label:"Using GCC",sidebar_position:5},sidebar:"jupiter",previous:{title:"\ud83d\udda5\ufe0f App Development",permalink:"/docs/jupiter/application-development"},next:{title:"Using Docker",permalink:"/docs/jupiter/application-development/docker"}},r={},c=[{value:"Install GCC",id:"install-gcc",level:2},{value:"Hello World test program",id:"hello-world-test-program",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-gcc",children:"Using GCC"}),"\n",(0,t.jsx)(n.p,{children:"After Jupiter is installed with Ubuntu, Bianbu systems, it supports onboard development. Here, we take the use of GCC to compile a test program as an example to introduce the onboard development method."}),"\n",(0,t.jsx)(n.h2,{id:"install-gcc",children:"Install GCC"}),"\n",(0,t.jsx)(n.p,{children:"Ubuntu Desktop and Bianbu Desktop versions have gcc installed by default. You can view the version of gcc by running the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"milkv@k1:~$ gcc -v\nUsing built-in specs.\nCOLLECT_GCC=gcc\nCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/riscv64-linux-gnu/13/lto-wrapper\nTarget: riscv64-linux-gnu\nConfigured with: ../src/configure -v --with-pkgversion='Ubuntu 13.2.0-4ubuntu3-bb2' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=riscv64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-multilib --with-arch=rv64gc --with-abi=lp64d --enable-checking=release --build=riscv64-linux-gnu --host=riscv64-linux-gnu --target=riscv64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2\nThread model: posix\nSupported LTO compression algorithms: zlib zstd\ngcc version 13.2.0 (Ubuntu 13.2.0-4ubuntu3-bb2)\n"})}),"\n",(0,t.jsx)(n.p,{children:"If gcc is not installed in your system, you can install it with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"sudo apt update\nsudo apt install build-essential\n"})}),"\n",(0,t.jsx)(n.h2,{id:"hello-world-test-program",children:"Hello World test program"}),"\n",(0,t.jsxs)(n.p,{children:["Create a new test file ",(0,t.jsx)(n.code,{children:"hello.c"}),", you can use the touch command to create it in the command line:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"touch hello.c\n"})}),"\n",(0,t.jsx)(n.p,{children:"Edit the file content as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-C",children:'#include <stdio.h>\n\nint main() {\n    printf("Hello, World!\\n");\n    return 0;\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Compile:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"gcc -o hello hello.c\n"})}),"\n",(0,t.jsx)(n.p,{children:"Run the generated program hello:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"./hello\n"})}),"\n",(0,t.jsx)(n.p,{children:"The output is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"milkv@k1:~$ ./hello\nHello, World!\n"})})]})}function u(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},11151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>o});var t=i(67294);const l={},s=t.createContext(l);function o(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.