Gitlab-ci.yml error

I can’t get my pipeline to work correctly. I have a class in a small C++ project, which I have tested on my local Mac, but when I run the same code it GitLab CI, it doesnt work. I use the .gitlab-ci.yml below and get the log following it. How can I tackle this?

.gitlab-ci.yml:

stages:
    - Build
    - Run

Build:
    stage: Build
    script:
        - make

Run:
    stage: Run
    script:
        - ./hello-ci.out

Log:

Running with gitlab-runner 12.10.0-rc2 (6c8c540f) on docker-auto-scale fa6cab46

Preparing the "docker+machine" executor
 Using Docker executor with image ruby:2.5 ...
 Pulling docker image ruby:2.5 ...
 Using docker image sha256:a98425292e846f475eabbae2d96922efe869b66538fa84efaaaef7b5125bd86a for ruby:2.5 ...

Preparing environment
 Running on runner-fa6cab46-project-18619802-concurrent-0 via runner-fa6cab46-srm-1588788543-f0802e0d...

Getting source from Git repository
  00:02
 $ eval "$CI_PRE_CLONE_SCRIPT"
 Fetching changes with git depth set to 50...
 Initialized empty Git repository in /builds/MY_PAGE_NAME/MY_PROJECT_NAME/.git/
 Created fresh repository.
 From https://gitlab.com/MY_PAGE_NAME/MY_PROJECT_NAME
 * [new ref]         refs/pipelines/143443421 -> refs/pipelines/143443421
 * [new branch]      testing-gitlab-ci        -> origin/testing-gitlab-ci
 Checking out c4673c82 as testing-gitlab-ci...
 Skipping Git submodules setup

Restoring cache

Downloading artifacts
  00:02

Running before_script and script
  00:01
 $ make
 g++    -c -o my_class.o my_class.cpp
 my_class.cpp:4:50: error: no match for 'operator=' (operand types are 'std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >' and 'std::chrono::_V2::system_clock::time_point' {aka 'std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >'})
    start = std::chrono::high_resolution_clock::now();
                                                    ^
 In file included from my_class.hpp:4,
                  from my_class.cpp:1:
/usr/include/c++/8/chrono:616:14: note: candidate: 'constexpr std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >& std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >::operator=(const std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&)'
        struct time_point
               ^~~~~~~~~~
 /usr/include/c++/8/chrono:616:14: note:   no known conversion for argument 1 from 'std::chrono::_V2::system_clock::time_point' {aka 'std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >'} to 'const std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&'
 /usr/include/c++/8/chrono:616:14: note: candidate: 'constexpr std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >& std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >::operator=(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&&)'
 /usr/include/c++/8/chrono:616:14: note:   no known conversion for argument 1 from 'std::chrono::_V2::system_clock::time_point' {aka 'std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >'} to 'std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&&'
 my_class.cpp: In member function 'void my_class::my_function()':
 my_class.cpp:8:48: error: no match for 'operator=' (operand types are 'std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >' and 'std::chrono::_V2::system_clock::time_point' {aka 'std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >'})

make: *** [<builtin>: my_class.o] Error 1

Running after_script 
  00:02

Uploading artifacts for failed job 
  00:01

  ERROR: Job failed: exit code 1

(This may be related to C++ and the code itself, but since it works locally but not on GitLab, I figured it’s something to do with how the runners or such are configured)

I think this is not related to GitLab at all. Did you check which g++ version you use to compile this on your mac and on your GitLab Runner instance? Do they compile with the same flags and C++ standard version?