dimanche 24 juin 2018

C++ 11 make error Ubuntu 16.04 : error: no match for call to ‘(std::ostream {aka std::basic_ostream

Context:- I am working on an assignment by using OpenCV, Boost::filesystem and C++ 11; and trying to build my code manually using CMake + Make method

Problem:- I am getting a make error as reproduced below :

/home/Desktop/DataSet/lane_detect/src/lane_detect.cpp:48:128: error: no match for call to ‘(std::ostream {aka std::basic_ostream<char>}) (const char [112])’

and the make fails with the following error description.

Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Since it points to line 48 of my code, I am reproducing my line 48 below:

std::cout("Something..\nsomething else...\n");

My int main function is shown below:

int main(int argc, char *argv[])

Extra information:-

I am using the following headers in my code:

#include <iostream>
#include <ostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include "opencv2/opencv.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <boost/filesystem.hpp>

My CMakeLists.txt file is shown below:

cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project( lane_detect CXX)
find_package( OpenCV REQUIRED )
find_package(Boost COMPONENTS system filesystem REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})

set (CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(Boost_INCLUDE_DIR /usr/local/src/boost_1_58_0)
set(Boost_LIBRARY_DIR /usr/local/src/boost_1_58_0/stage/lib)

add_executable(lane_detect src/lane_detect.cpp)
target_link_libraries(lane_detect PRIVATE ${OpenCV_LIBS} ${Boost_LIBRARIES})

My Ubuntu compiler details are shown below:

ii  g++                                          4:5.3.1-1ubuntu1                                                    amd64        GNU C++ compiler
ii  g++-5                                        5.5.0-12ubuntu1~16.04                                               amd64        GNU C++ compiler
ii  g++-6                                        6.4.0-17ubuntu1~16.04                                               amd64        GNU C++ compiler
ii  gcc                                          4:5.3.1-1ubuntu1                                                    amd64        GNU C compiler
ii  gcc-5                                        5.5.0-12ubuntu1~16.04                                               amd64        GNU C compiler
ii  gcc-6                                        6.4.0-17ubuntu1~16.04                                               amd64        GNU C compiler
ii  gfortran                                     4:5.3.1-1ubuntu1                                                    amd64        GNU Fortran 95 compiler
ii  gfortran-5                                   5.5.0-12ubuntu1~16.04                                               amd64        GNU Fortran compiler
ii  hardening-includes                           2.7ubuntu2                                                          all          Makefile for enabling compiler flags for security hardening
ii  libecj-java                                  3.10.1-2ubuntu1                                                     all          Eclipse Java compiler (library)
ii  libllvm3.6v5:amd64                           1:3.6.2-3ubuntu2                                                    amd64        Modular compiler and toolchain technologies, runtime library
ii  libllvm3.8:amd64                             1:3.8-2ubuntu4                                                      amd64        Modular compiler and toolchain technologies, runtime library
ii  libllvm5.0:amd64                             1:5.0-3~16.04.1                                                     amd64        Modular compiler and toolchain technologies, runtime library
ii  libprotoc-dev:amd64                          2.6.1-1.3                                                           amd64        protocol buffers compiler library (development files)
ii  libprotoc9v5:amd64                           2.6.1-1.3                                                           amd64        protocol buffers compiler library
ii  libxkbcommon-dev                             0.5.0-1ubuntu2                                                      amd64        library interface to the XKB compiler - development files
ii  libxkbcommon0:amd64                          0.5.0-1ubuntu2                                                      amd64        library interface to the XKB compiler - shared library
ii  protobuf-compiler                            2.6.1-1.3                                                           amd64        compiler for protocol buffer definition files
ii  sbcl                                         2:1.3.1-1ubuntu2                                                    amd64        Common Lisp compiler and development system

Aucun commentaire:

Enregistrer un commentaire