Click here to Skip to main content
15,883,711 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
When trying to compile the host code using <make> command in MobaXterm terminal. I got this error. I am not sure what to do to fix this error. I need help

In file included from /usr/include/c++/4.8.2/array:35:0,
                     from host/src/host.cpp:16:
    /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
     #error This file requires compiler and library support for the \
      ^


I need help to fix this error please .

What I have tried:

I am not sure what to do to fix this problem so far
Posted
Updated 15-Sep-21 1:42am

1 solution

Do what the message tells you and add the appropriate option to the Makefile entry for that source module.
 
Share this answer
 
Comments
prother123 15-Sep-21 8:00am    
thank you for reply. But I am not sure what to add to my Makefile
Richard MacCutchan 15-Sep-21 8:03am    
Add the option the the CPPFLAGS macro entry in the file.
prother123 15-Sep-21 8:07am    
Could you please add the proper option to my Makefile that I just attached
prother123 15-Sep-21 8:04am    
This is my Makefile:

ifeq ($(VERBOSE),1)
ECHO :=
else
ECHO := @
endif

# Where is the Intel(R) FPGA SDK for OpenCL(TM) software?
ifeq ($(wildcard $(INTELFPGAOCLSDKROOT)),)
$(error Set INTELFPGAOCLSDKROOT to the root directory of the Intel(R) FPGA SDK for OpenCL(TM) software installation)
endif
ifeq ($(wildcard $(INTELFPGAOCLSDKROOT)/host/include/CL/opencl.h),)
$(error Set INTELFPGAOCLSDKROOT to the root directory of the Intel(R) FPGA SDK for OpenCL(TM) software installation.)
endif

# OpenCL compile and link flags.
AOCL_COMPILE_CONFIG := $(shell aocl compile-config )
AOCL_LINK_CONFIG := $(shell aocl link-config )

# Compilation flags
ifeq ($(DEBUG),1)
CXXFLAGS += -g
else
CXXFLAGS += -O2
endif

# Compiler
CXX := g++

# Target
TARGET := host
TARGET_DIR := bin

# Directories
INC_DIRS := ../common/inc
LIB_DIRS :=

# Files
INCS := $(wildcard )
SRCS := $(wildcard host/src/*.cpp ../common/src/AOCLUtils/*.cpp)
LIBS := rt pthread

# Make it all!
all : $(TARGET_DIR)/$(TARGET)

# Host executable target.
$(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INCS) $(TARGET_DIR)
$(ECHO)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
$(AOCL_COMPILE_CONFIG) $(SRCS) $(AOCL_LINK_CONFIG) \
$(foreach D,$(LIB_DIRS),-L$D) \
$(foreach L,$(LIBS),-l$L) \
-o $(TARGET_DIR)/$(TARGET)

$(TARGET_DIR) :
$(ECHO)mkdir $(TARGET_DIR)

# Standard make targets
clean :
$(ECHO)rm -f $(TARGET_DIR)/$(TARGET)

.PHONY : all clean
Richard MacCutchan 15-Sep-21 9:12am    
Change both entries named CXXFLAGS by adding a space followed by -std=c++11 after the existing text.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900