
Toolchain
for 32bit
- i686-w64-mingw32-gcc
- i686-w64-mingw32-ar
for 64bit
- x86_64-w64-mingw32-gcc
- x86_64-w64-mingw32-ar
32bit windows target 예 )
hello.h
#ifndef _HELLO_H_
#define _HELLO_H_
extern void hello();
#endif
hello.c
#include "hello.h"
#include <stdio.h>
void hello()
{
printf("hello, world\n");
}
오브젝트 파일 생성
$ i686-w64-mingw32-gcc -c hello.c -o hello.o
$ i686-w64-mingw32-gcc -c hello.c -o hello.o
정적 라이브러리 생성
$ i686-w64-mingw32-ar rscv libhello.a hello.o
테스트 (gcc version: gcc.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 7.3.0)

'Linux' 카테고리의 다른 글
| [Yocto Study #1] Yocto 프로젝트란? (2) | 2026.01.10 |
|---|---|
| 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다 (0) | 2025.09.10 |
| Files/directories were installed but not shipped in any package (0) | 2025.08.19 |
| bitbake: 명령을 찾을 수 없습니다 (0) | 2025.08.14 |
| Files/directories were installed but not shipped in any package: (0) | 2025.07.31 |