1. 编译
xxg@xxg-desktop:~/1-wire/OSS_C_API/build$ cmake ../.
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_STDBOOL_H
-- Looking for include files HAVE_STDBOOL_H - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxg/1-wire/OSS_C_API/build
xxg@xxg-desktop:~/1-wire/OSS_C_API/build$ make install
[ 37%] Built target osscore_shared
[ 74%] Built target osscore_static
[ 75%] Built target ossextra_shared
[ 76%] Built target ossextra_static
[ 77%] Built target create_bucket
[ 77%] Built target delete_bucket
[ 78%] Built target get_bucket_acl
[ 78%] Built target is_bucket_exist
[ 79%] Built target list_buckets
[ 80%] Built target list_objects_with_bucket_name
[ 81%] Built target list_objects_with_prefix
[ 81%] Built target list_objects_with_request
[ 82%] Built target set_bucket_acl
[ 82%] Built target abort_multipart_upload
[ 83%] Built target complete_multipart_upload
[ 84%] Built target initiate_multipart_upload
[ 84%] Built target list_multipart_upload
[ 85%] Built target list_parts
[ 86%] Built target upload_part
[ 86%] Built target copy_object
[ 87%] Built target copy_object_ext
[ 88%] Built target delete_multiple_object
[ 88%] Built target delete_object
[ 88%] Built target get_compressed_object_to_buffer
[ 89%] Built target get_compressed_object_to_file
[ 90%] Built target get_object_metadata
[ 90%] Built target get_object_to_buffer
[ 91%] Built target get_object_to_buffer_2nd
[ 91%] Built target get_object_to_file
[ 91%] Built target put_compressed_object_from_buffer
[ 92%] Built target put_object_from_buffer
[ 92%] Built target put_object_from_file
[ 93%] Built target put_object_multithreaded
[ 94%] Built target delete_object_group
[ 95%] Built target get_object_group_index
[ 95%] Built target get_object_group_to_buffer
[ 96%] Built target get_object_group_to_file
[ 97%] Built target head_object_group
[ 98%] Built target post_object_group
[ 99%] Built target generate_presigned_url_with_expiration
[ 99%] Built target generate_presigned_url_with_method
[ 99%] Built target sync_download
[100%] Built target sync_upload
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libosscore.a
CMake Error at src/cmake_install.cmake:36 (FILE):
file INSTALL cannot copy file
"/home/xxg/1-wire/OSS_C_API/build/src/libosscore.a" to
"/usr/local/lib/libosscore.a".
Call Stack (most recent call first):
cmake_install.cmake:37 (INCLUDE)
make: *** [install] Error 1
2. 单独编译
build.sh
-
#!/bin/sh
-
-
BUILD_LIB=0
-
-
cd ../build
-
-
if [ $BUILD_LIB -eq 1 ]; then
-
#1. Linking C static library libosscore.a, 文件在 src目录下, 可以修改 build.make
-
make -f src/CMakeFiles/osscore_static.dir/build.make src/CMakeFiles/osscore_static.dir/build
-
cp src/libosscore.a ../bin_op
-
-
#2. Linking C shared library libosscore.so
-
#make -f src/CMakeFiles/osscore_shared.dir/build.make src/CMakeFiles/osscore_shared.dir/build
-
-
fi
-
-
#5. 单独编译某个文件, Linking C executable get_object_to_file. .o 文件在 /example/object/CMakeFiles/get_object_to_file.dir
-
make -f example/object/CMakeFiles/get_object_to_file.dir/build.make example/object/CMakeFiles/get_object_to_file.dir/build
-
-
cp example/object/CMakeFiles/get_object_to_file.dir/get_object_to_file.c.o ../bin_op