zoom / meetingsdk-linux-raw-recording-sample

MIT License
21 stars 9 forks source link

cannot docker build #13

Closed sprinter707 closed 3 weeks ago

sprinter707 commented 3 weeks ago

Hello.

I completed cmake -B build and I run docker build, but I got an error.

❯ docker build --no-cache -t msdk-6.0.2-on-centos8-compact -f Dockerfile-Centos8/Dockerfile .
[+] Building 146.6s (15/18)                                                                                   docker:default
 => [internal] load build definition from Dockerfile                                                                    0.0s
 => => transferring dockerfile: 1.66kB                                                                                  0.0s
 => [internal] load .dockerignore                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load metadata for quay.io/centos/centos:8                                                                2.9s
 => [ 1/14] FROM quay.io/centos/centos:8@sha256:ec16f510e8cd1cceeddc6888fcb37c6d6b7c6863fbc70bdbe660a8ccad4bab6a        0.0s
 => [internal] load build context                                                                                       0.1s
 => => transferring context: 278.10kB                                                                                   0.1s
 => CACHED [ 2/14] WORKDIR /etc/yum.repos.d/                                                                            0.0s
 => [ 3/14] RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*                                           0.3s
 => [ 4/14] RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS  0.4s
 => [ 5/14] RUN yum update -y                                                                                          33.1s
 => [ 6/14] RUN yum install -y dnf-plugins-core     && dnf install -y cmake gcc gcc-c++     && dnf config-manager --s  58.3s
 => [ 7/14] RUN yum install -y glib2-devel                                                                             41.0s
 => [ 8/14] RUN yum install -y pulseaudio pulseaudio-utils                                                              5.2s
 => [ 9/14] WORKDIR /app                                                                                                0.0s
 => [10/14] COPY demo/ /app/demo/                                                                                       1.8s
 => ERROR [11/14] RUN cd /app/demo && rm -rf bin && rm -rf build && cmake -B build && cd build && make                  3.6s
------
 > [11/14] RUN cd /app/demo && rm -rf bin && rm -rf build && cmake -B build && cd build && make:
0.890 -- The CXX compiler identification is GNU 8.5.0
0.908 -- Detecting CXX compiler ABI info
1.019 -- Detecting CXX compiler ABI info - done
1.025 -- Check for working CXX compiler: /usr/bin/c++ - skipped
1.025 -- Detecting CXX compile features
1.026 -- Detecting CXX compile features - done
1.030 -- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
1.049 -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
1.049 -- Checking for module 'glib-2.0'
1.059 --   Found glib-2.0, version 2.56.4
1.073 -- Checking for module 'gio-2.0'
1.080 --   Found gio-2.0, version 2.56.4
1.396 -- Configuring done
1.403 -- Generating done
1.404 -- Build files have been written to: /app/demo/build
1.438 [  8%] Building CXX object CMakeFiles/meetingSDKDemo.dir/meeting_sdk_demo.cpp.o
1.934 [ 16%] Building CXX object CMakeFiles/meetingSDKDemo.dir/MeetingReminderEventListener.cpp.o
2.054 [ 25%] Building CXX object CMakeFiles/meetingSDKDemo.dir/MeetingServiceEventListener.cpp.o
2.175 [ 33%] Building CXX object CMakeFiles/meetingSDKDemo.dir/NetworkConnectionHandler.cpp.o
2.292 [ 41%] Building CXX object CMakeFiles/meetingSDKDemo.dir/AuthServiceEventListener.cpp.o
2.409 [ 50%] Building CXX object CMakeFiles/meetingSDKDemo.dir/MeetingParticipantsCtrlEventListener.cpp.o
2.444 [ 58%] Building CXX object CMakeFiles/meetingSDKDemo.dir/MeetingRecordingCtrlEventListener.cpp.o
2.476 [ 66%] Building CXX object CMakeFiles/meetingSDKDemo.dir/ZoomSDKRenderer.cpp.o
2.609 [ 75%] Building CXX object CMakeFiles/meetingSDKDemo.dir/ZoomSDKAudioRawData.cpp.o
2.737 [ 83%] Building CXX object CMakeFiles/meetingSDKDemo.dir/ZoomSDKVideoSource.cpp.o
2.932 [ 91%] Building CXX object CMakeFiles/meetingSDKDemo.dir/ZoomSDKVirtualAudioMicEvent.cpp.o
3.168 [100%] Linking CXX executable ../bin/meetingSDKDemo
3.199 /usr/bin/ld: skipping incompatible /app/demo/lib/zoom_meeting_sdk/libmeetingsdk.so when searching for -lmeetingsdk
3.199 /usr/bin/ld: cannot find -lmeetingsdk
3.199 /usr/bin/ld: skipping incompatible /app/demo/lib/zoom_meeting_sdk/libmeetingsdk.so when searching for -lmeetingsdk
3.199 /usr/bin/ld: cannot find -lmeetingsdk
3.200 collect2: error: ld returned 1 exit status
3.201 make[2]: *** [CMakeFiles/meetingSDKDemo.dir/build.make:257: ../bin/meetingSDKDemo] Error 1
3.201 make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/meetingSDKDemo.dir/all] Error 2
3.201 make: *** [Makefile:91: all] Error 2
------
Dockerfile:33
--------------------
  31 |
  32 |     # Execute additional commands
  33 | >>>  RUN cd /app/demo && rm -rf bin && rm -rf build && cmake -B build && cd build && make
  34 |
  35 |      # Set the working directory to the binary folder
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /app/demo && rm -rf bin && rm -rf build && cmake -B build && cd build && make" did not complete successfully: exit code: 2

how to solve this problem :( ?

tanchunsiong commented 3 weeks ago

did you copy the SDK files into this sample code?

3.199 /usr/bin/ld: skipping incompatible /app/demo/lib/zoom_meeting_sdk/libmeetingsdk.so when searching for -lmeetingsdk 3.199 /usr/bin/ld: cannot find -lmeetingsdk 3.199 /usr/bin/ld: skipping incompatible /app/demo/lib/zoom_meeting_sdk/libmeetingsdk.so when searching for -lmeetingsdk 3.199 /usr/bin/ld: cannot find -lmeetingsdk

sprinter707 commented 3 weeks ago

Yes. I copied the .so files.

source code

❯ ls -al
total 72
drwxrwxr-x@ 12 jasper  staff   384  8 20 15:59 .
drwxr-xr-x@ 26 jasper  staff   832  8 21 15:54 ..
-rw-r--r--@  1 jasper  staff  8196  8 21 15:55 .DS_Store
drwxr-xr-x  13 jasper  staff   416  8 21 16:17 .git
-rw-rw-r--@  1 jasper  staff   451  6 21 17:36 .gitignore
drwxrwxr-x@  3 jasper  staff    96  8 21 15:04 Dockerfile-Centos8
drwxrwxr-x@  3 jasper  staff    96  6 21 17:36 Dockerfile-Centos9
drwxrwxr-x@  3 jasper  staff    96  6 21 17:36 Dockerfile-Ubuntu
-rw-rw-r--@  1 jasper  staff  1088  6 21 17:36 LICENSE.md
-rw-rw-r--@  1 jasper  staff  9290  6 21 17:36 README.md
drwxrwxr-x@ 32 jasper  staff  1024  8 21 15:55 demo
-rw-rw-r--@  1 jasper  staff     5  6 21 17:36 version.txt
❯ pwd
/Users/jasper/Desktop/Workspaces/orelo-zoom-be

library

❯ ls -al
total 720600
drwxrwxr-x@ 9 jasper  staff        288  8 21 16:11 .
drwxrwxr-x@ 4 jasper  staff        128  8 20 14:45 ..
-rw-r--r--@ 1 jasper  staff       6148  8 21 16:11 .DS_Store
drwxr-xr-x@ 3 jasper  staff         96  8 20 13:43 json
-rwxr-xr-x@ 1 jasper  staff  183860952  8 20 13:42 libmeetingsdk.so
-rwxr-xr-x@ 1 jasper  staff  183860952  8 20 13:42 libmeetingsdk.so.1
-rwxr-xr-x@ 1 jasper  staff    1214824  8 20 13:42 libmpg123.so
drwxr-xr-x@ 4 jasper  staff        128  8 20 14:45 qt_libs
-rw-rw-r--@ 1 jasper  staff          0  6 21 17:36 readme.md
❯ pwd
/Users/jasper/Desktop/Workspaces/orelo-zoom-be/demo/lib/zoom_meeting_sdk
sprinter707 commented 3 weeks ago

I solved the problem. I use a MacBook M1 chip. This MacBook uses arm64 architecture. But Zoom SDK supports x86_64(amd, intel chip).

Depending on the OS of the execution environment, if it is ARM64, install centos using ARM64 architecture, and download gcc and the version corresponding to ARM64.

In Dockerfile, FROM quay.io/centos/centos:8 is install ARM64 centOS in m1 macbook.

I change the line to FROM --platform=linux/amd64 centos:8.

It installs centOS using AMD64 architecture.

And change the zoom SDK version to 6.0.2.

Build success!