1-1 개발 환경 설정

do·2022년 3월 2일
0

API

목록 보기
1/42

WSL2 & 우분투 설치

https://www.digitalocean.com/community/tutorials/how-to-install-the-windows-subsystem-for-linux-2-on-microsoft-windows-10

  1. Windows Powershell 실행 (관리자로 실행)
  2. PS C:\Windows\system32> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  3. PS C:\Windows\system32> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  4. Download and run wsl_update_x64.msi
  • 파일 실행 불가 -> Windows 기능 켜기/끄기에서 Linux용 Windows 하위 시스템 & 가상 머신 플랫폼 체크 해제 후 다시시작하고, 체크하고 또 다시시작..
  1. 디폴트 버전 세팅하기
    PS C:\Windows\system32> wsl --set-default-version 2
  2. MS스토어에서 Ubuntu 20.04 설치
  3. Ubuntu 에러
  • WslRegisterDistribution failed with error: 0x80370102
    Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
    -> Bios setting 들어가서 Intel Virtualization Technology 체크하기
  1. Ubuntu username/passwd 등록
  2. MS스토어에서 Windows Terminal 설치
  3. 설정에서 기본 프로필 Ubuntu로 변경

패키지 설치 및 실행

1. gcc


unable to fetch some archives, maybe run apt-get update
gcc -c: object 파일 생성
gcc -o: output 파일 생성

apt-get install 스크립트 작성할때 유리함/더 많은 기능
apt install 자주 사용하는 옵션 추출해서 사용자들이 보기 편함
그 외 동작 비슷함

2. make

vim Makefile
결과파일 자동변경 가능

3. gdb

디버깅 gdb test_exe
종료 (gdb) q ctrl+d
b breakpoint
b function b 10 b *0x8049000 tb(temp b) i b(info b) d
l list
r run
k kill
s step; 현재 행 수행 후 정지. 함수 호출시 함수 안으로 들어감
s 5 s 다섯번 수행
n next; 현재 행 수행 후 정지. 함수 호출시 함수 수행 다음 행으로 들어감
n 5 n 다섯번 수행
c continue
u 현재 루프를 빠져나감
watch[변수명] watch point
p[변수명] 해당 변수 value 출력 (포인터 입력시 주소값 출력)
p$[레지스터명] 레지스터값 출력
p*[포인터] struct/class의 배열일때 배열의 크기를 알림

4. git

  1. sudo apt-get install git
  2. sudo apt install git
  3. git version 2.25.1
  4. git config --global user.name abc
  5. git config --global user.mail 11@11.com -- fix identity with git commit --amend --reset-author
  6. 사용하는 에디터 git config --global core.editor vim
  7. merge시 두 소스의 차이점 수정 git config --global merge.tool vimdiff
  8. sudo git clone https://github.com/doheeklm/git_test.git
    -sudo 안하면 error: chmod on /mnt/c/Users/user/git_test/.git/config.lock failed: Operation not permitted
    fatal: could not set 'core.filemode' to 'false'
  • commit message template
  • git config --global color.ui auto color
  • git status

sudo git init git 로컬저장소 생성
sudo git remote add origin https://github.com/doheeklm/Git.git 원격저장소 등록
git remote -v 원격저장소 관리
git add test_exe -> Changes to be committed
git commit -m test_exe -m(no message)
git push origin master

github 비번 토큰

0개의 댓글