W2 <<
Previous Next >> W4 W5
W3
Webots設定
MSYS2裡建立Windows 64位元環境下gcc編譯環境,安裝mingw-w64-x86_64-gcc 與 mingw-w64-x86_64-toolchain。
<!-- 安裝 mingw-w64-x86_64-gcc -->
pacman -S mingw-w64-x86_64-gcc
<!-- 安裝 mingw-w64-x86_64-toolchain -->
pacman -S mingw-w64-x86_64-toolchain
安裝完成後,測試編譯以下簡單的 C 程式:
// hello.c
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
存在 tmp\c_ex 目錄下,命名為 hello.c然後利用:
gcc -o hello.exe hello.c
表示要將編譯 hello.c 的 output 設為 hello.exe 完成後,直接執行 hello.exe
W2 <<
Previous Next >> W4 W5