Skip to content

Instantly share code, notes, and snippets.

@sol-prog
Last active November 20, 2024 22:37

Revisions

  1. sol-prog renamed this gist Jun 29, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. sol-prog revised this gist Jun 28, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion commands.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Commands used in the video:
    # Commands used in the video https://youtu.be/-bCG87jBDqA :

    sudo apt update && sudo apt upgrade -y

  3. sol-prog created this gist Jun 28, 2019.
    25 changes: 25 additions & 0 deletions commands.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # Commands used in the video:

    sudo apt update && sudo apt upgrade -y

    git clone https://bitbucket.org/sol_prog/raspberry-pi-gcc-binary.git
    cd raspberry-pi-gcc-binary
    tar -xjvf gcc-9.1.0-armhf-raspbian.tar.bz2
    sudo mv gcc-9.1.0 /opt
    cd ..
    rm -rf raspberry-pi-gcc-binary

    cd ~
    echo 'export PATH=/opt/gcc-9.1.0/bin:$PATH' >> ~/.bashrc
    echo 'export LD_LIBRARY_PATH=/opt/gcc-9.1.0/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
    . ~/.bashrc
    sudo ln -s /usr/include/arm-linux-gnueabihf/sys /usr/include/sys
    sudo ln -s /usr/include/arm-linux-gnueabihf/bits /usr/include/bits
    sudo ln -s /usr/include/arm-linux-gnueabihf/gnu /usr/include/gnu
    sudo ln -s /usr/include/arm-linux-gnueabihf/asm /usr/include/asm
    sudo ln -s /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib/crti.o
    sudo ln -s /usr/lib/arm-linux-gnueabihf/crt1.o /usr/lib/crt1.o
    sudo ln -s /usr/lib/arm-linux-gnueabihf/crtn.o /usr/lib/crtn.o

    g++-9.1 -std=c++17 -Wall -pedantic test_fs.cpp -o test_fs
    ./test_fs
    10 changes: 10 additions & 0 deletions test_fs.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    // Build/compile with:
    // g++-9.1 -std=c++17 -Wall -pedantic test_fs.cpp -o test_fs
    #include <iostream>
    #include <filesystem>

    int main() {
    for(auto &file : std::filesystem::recursive_directory_iterator("./")) {
    std::cout << file.path() << '\n';
    }
    }