ubuntu 16.04 LTS에서 python 3.8 설치

 

$ sudo apt update

$ sudo apt install software-properties-common

$ sudo add-apt-repository ppa:deadsnakes/ppa

$ sudo apt update

$ sudo apt install python3.8

공식 홈페이지는 여기


설치.


$ sudo apt-get install libcurl4-openssl-dev


다음 명령어를 통해 빌드옵션을 확인할 수 있다.


$ curl-config --cflags

$ curl-config --libs


아래와 같이 빌드


$ gcc -o test.out test.c -L/usr/lib/x86_64-linux-gnu -lcurl


공식 홈페이지는 여기


libxml2 Git web에서 체크아웃 하자.


$ git clone git://git.gnome.org/libxml2


FAQ의 Compilation 항목을 보면, 4번 항목에 SVN 버전을 사용하며 configure 스크립트가 없는 경우에 대해 나와있다.

아래와 같이 입력하자.


$ ./autogen.sh --prefix=/usr/local --disable-shared


이어서 아래와 같이 입력하면 설치 끝


$ make

$ sudo make install


다음 명령어를 통해 빌드옵션을 확신할 수 있다.


$ xml2-config --cflags

$ xml2-config --libs


아래와 같이 빌드


$ gcc -o test.out test.c -I/usr/local/include/libxml2 -L/usr/local/lib -lxml2 -lm -ldl


TIP

1. 간단한 사용법

2. libxml 사용하여 xml 파싱하기

C언어에서 json-c 라이브러리를 사용하여 json 파싱


GitHub repo로 가보자


README.md를 잘 읽어보면..


사전에 필요한 것들:

  • gcc, clang과 같은 C 컴파일러
  • libtool

tarball을 사용하지 않는다면, 이것들도 필요:

  • autoconf(autoreconf)
  • automake

나는 libtool, autoconf 및 automake를 설치했다.

우분투에서:

$ sudo apt-get install libtool $ sudo apt-get install autoconf

$ sudo apt-get install automake


clone하여 json-c 설치

$ git clone https://github.com/json-c/json-c.git $ cd json-c json-c$ sh autogen.sh json-c$ ./configure --prefix=/usr/local json-c$ make json-c$ make install

테스트 프로그램을 실행

$ make check


여기까지 했으면

json-c 라이브러리는 /usr/local/lib/에

json-c 헤더파일은 /usr/local/include/json-c/에 복사된다.


json-c 라이브러리를 사용하는 코드를 작성하고 Makefile을 통해 컴파일 하자.

작성한 코드는 json-example.c 라는 파일명으로 저장했다고 하면 Makefile은 아래와 같이 만들 수 있다.


Makefile 작성

all: static static:     gcc -static json-example.c -L/usr/local/lib -ljson-c -I/usr/local/include/json-c -o json-example-static     ./json-example-static shared:     gcc json-example.c -L/usr/local/lib -ljson-c -I/usr/local/include/json-c -o json-example-shared     ./json-example-shared .PHONY: all static shared


run

$ make static

또는

$ make shared


reference:

http://thesystemisntdown.coolaj86.com/2010/06/json-c-example.html


Ubuntu에 LAMP 설치

+ Recent posts