From b9475855cc2a333ecbe5a9762c5ff3939f09da64 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Tue, 19 Mar 2019 11:15:42 +0100 Subject: [PATCH] attempt to fix CI --- .gitlab-ci.yml | 4 ++++ src/main.cc | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8157f0d..713bab3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,9 @@ image: conanio/clang7 +variables: + CC: /usr/bin/clang + CXX: /usr/bin/clang++ + build: stage: build before_script: diff --git a/src/main.cc b/src/main.cc index d067115..89c5517 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,24 @@ #include +#include +#include + +using namespace std; int main(int argc, char **argv) { - std::cout << "Hello World!\n"; + if (argc != 2) { + cout << " Usage: display_image ImageToLoadAndDisplay" << endl; + return -1; + } + + cv::Mat image = cv::imread(argv[1], cv::IMREAD_COLOR); // Read the file + + if (!image.data) // Check for invalid input + { + cout << "Could not open or find the image" << std::endl; + return -1; + } else { + cout << "Loaded image!\n"; + } + return 0; }