Docker Community Forums

Share and learn in the Docker community.

Compiling opencv with from openjdk 11 gives cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’

When I use openjdk8, the service starts fine, but when I switch to openjdk11, I get

[  1%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
cc1: warning: command-line option ‘-Wsign-promo’ is valid for C++/ObjC++ but not for C
cc1: warning: command-line option ‘-Wno-delete-non-virtual-dtor’ is valid for C++/ObjC++ but not for C
cc1: warning: command-line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C

····

What am I doing wrong?

Here is my dockerfile configuration

#
FROM openjdk:8

ADD /cmmop-device-camstatus-0.0.1.jar /app.jar

ADD /opencv-3.4.4.zip /home/

ADD /capdetect.so /home/LibCamStatus/capdetect.so


EXPOSE 8686

ENTRYPOINT ["/bin/sh", "-c","java  -jar /app.jar"]

# 
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 
RUN echo 'Asia/Shanghai' >/etc/timezone

# 
RUN unzip -d /home/ /home/opencv-3.4.4.zip 
# 
RUN mkdir /home/opencv-3.4.4/build
# 
ENV ANT_HOME /usr/local/ant
ENV PATH $PATH:${ANT_HOME}

# 
RUN apt-get update \
    && apt-get install build-essential -y \
    && apt-get install libsasl2-dev -y\
    && apt-get install apt-utils -y \
    && apt-get install pkg-config -y \
    && apt-get install cmake -y \
    && apt-get install ant -y
# cd 
WORKDIR /home/opencv-3.4.4/build
# 
RUN cmake -D WITH_TBB=ON -D WITH_EIGEN=ON  .. \
    cmake -D BUILD_DOCS=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF .. cmake -D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_gpuarithm=OFF -D BUILD_opencv_gpubgsegm=OFF -D BUILD_opencv_gpucodec=OFF -D BUILD_opencv_gpufeatures2d=OFF -D BUILD_opencv_gpufilters=OFF -D BUILD_opencv_gpuimgproc=OFF -D BUILD_opencv_gpulegacy=OFF -D BUILD_opencv_gpuoptflow=OFF -D BUILD_opencv_gpustereo=OFF -D BUILD_opencv_gpuwarping=OFF ..  \
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..\
    && make -j20 && make install

RUN echo "/usr/local/lib64" > /etc/ld.so.conf.d/opencv.conf

ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:$PKG_CONFIG_PATH
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64

docker version 20.10.8