LoginSignup
0
0

g++, clang++ and vscode++ をdockerで(まだエラー中)

Last updated at Posted at 2019-07-09

docker gcc(g++) and llvm(clang++)
https://qiita.com/kaizen_nagoya/items/059874ea39c4de64c0f7

docker and vscode not visual studio code
https://qiita.com/kaizen_nagoya/items/165a281570a8c62ca50a

g++

macOS
$ docker run -it gcc /bin/bash
Unable to find image 'gcc:latest' locally
latest: Pulling from library/gcc
6f2f362378c5: Pull complete 
494c27a8a6b8: Pull complete 
7596bb83081b: Pull complete 
372744b62d49: Pull complete 
615db220d76c: Pull complete 
dd1e0ba56aac: Pull complete 
b4c62fab8fa1: Pull complete 
df32917a83ac: Pull complete 
5100809ee8fa: Pull complete 
Digest: sha256:f46393c64e0e5a98aff814fec705582a08c3d8067196857910036ed324242ceb
Status: Downloaded newer image for gcc:latest

clang++/llvm

docker/ubuntu
# apt update; apt -y upgrade

# apt install clang+ 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binfmt-support clang-3.8 libclang-common-3.8-dev libclang1-3.8 libgc1c2
  libjsoncpp1 libllvm3.8 libobjc-6-dev libobjc4 libpipeline1 llvm-3.8
  llvm-3.8-dev llvm-3.8-runtime
Suggested packages:
  gnustep gnustep-devel clang-3.8-doc llvm-3.8-doc
The following NEW packages will be installed:
  binfmt-support clang clang-3.8 libclang-common-3.8-dev libclang1-3.8
  libgc1c2 libjsoncpp1 libllvm3.8 libobjc-6-dev libobjc4 libpipeline1 llvm-3.8
  llvm-3.8-dev llvm-3.8-runtime
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.0 MB of archives.

#vscode
Ubuntu / DebianにコマンドでVSCode (Visual Studio Code) をインストールする方法
https://www.karelie.net/ubuntu-debian-command-install-vscode/

docker/ubuntu
# curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   1644      0 --:--:-- --:--:-- --:--:--  1646

# install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
root@7a86e7a198a9:/# sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

# apt install apt-transport-https

# apt update
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian stretch Release 
Get:6 https://packages.microsoft.com/repos/vscode stable InRelease [3181 B]
Get:7 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages [126 kB]
Fetched 129 kB in 0s (131 kB/s)    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

# apt install code
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme at-spi2-core dconf-gsettings-backend dconf-service
  glib-networking glib-networking-common glib-networking-services
  gsettings-desktop-schemas libatk-bridge2.0-0 libatspi2.0-0 libcolord2
  libdconf1 libdrm2 libegl1-mesa libepoxy0 libgbm1 libgtk-3-0 libgtk-3-bin
  libgtk-3-common libjson-glib-1.0-0 libjson-glib-1.0-common libnotify4
  libnspr4 libnss3 libproxy1v5 librest-0.7-0 libsecret-1-0 libsecret-common
  libsoup-gnome2.4-1 libsoup2.4-1 libwayland-client0 libwayland-cursor0
  libwayland-egl1-mesa libwayland-server0 libx11-xcb1 libxcb-dri2-0
  libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxcb-xfixes0 libxkbcommon0
  libxkbfile1 libxshmfence1 libxss1 libxtst6 notification-daemon xkb-data
Suggested packages:
  colord gvfs
The following NEW packages will be installed:
  adwaita-icon-theme at-spi2-core code dconf-gsettings-backend dconf-service
  glib-networking glib-networking-common glib-networking-services
  gsettings-desktop-schemas libatk-bridge2.0-0 libatspi2.0-0 libcolord2
  libdconf1 libdrm2 libegl1-mesa libepoxy0 libgbm1 libgtk-3-0 libgtk-3-bin
  libgtk-3-common libjson-glib-1.0-0 libjson-glib-1.0-common libnotify4
  libnspr4 libnss3 libproxy1v5 librest-0.7-0 libsecret-1-0 libsecret-common
  libsoup-gnome2.4-1 libsoup2.4-1 libwayland-client0 libwayland-cursor0
  libwayland-egl1-mesa libwayland-server0 libx11-xcb1 libxcb-dri2-0
  libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxcb-xfixes0 libxkbcommon0
  libxkbfile1 libxshmfence1 libxss1 libxtst6 notification-daemon xkb-data
0 upgraded, 48 newly installed, 0 to remove and 0 not upgraded.
Need to get 77.3 MB of archives.

Effective ModernC++をclang++, g++でコンパイルしてみる
https://qiita.com/kaizen_nagoya/items/2fafaf28782d192e237e

# apt install vim sudo cmake wget
# wget https://github.com/BartVandewoestyne/Effective-Modern-Cpp/archive/master.zip
# unzip msdyrt.xip
# cd Effective-Modern-Cpp-master
# cmake CMakeLists.txt 
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is Clang 3.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Error at /usr/share/cmake-3.7/Modules/FindBoost.cmake:1831 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  Item04_Know_how_to_view_deduced_types/CMakeLists.txt:8 (find_package)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types
   used as include directory in directory /tmp/Effective-Modern-Cpp-master/Item04_Know_how_to_view_deduced_types

-- Configuring incomplete, errors occurred!
See also "/tmp/Effective-Modern-Cpp-master/CMakeFiles/CMakeOutput.log".
See also "/tmp/Effective-Modern-Cpp-master/CMakeFiles/CMakeError.log".

原因調査中。

ubuntu/docker
# code -h
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
# code --user-data-dir  /tmp
/usr/share/code/bin/../code: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

#@# 最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0