注意OpenCV 4.0.1 解决了这个问题请直接下载OpenCV 4.0.1

但是OpenCV 4.0.1作为模块导入Android Studio会有找不到R.styleable的问题

OpenCV 4.0.1 找不到R.styleable解决

OpenCV4Android支持三种使用方式

1.Java层调用
2.NDK调用动态库(方便,但是会包含整个.so库)
3.NDK调用静态库(灵活,比如没有用到机器学习模块,libopencv_ml.a里的代码是不会打包到动态库里的)
通过链接静态库的方式使用OpenCV4Android,CMAKE配置如下

#############################prepare for using of opencv static library####################
#first step to use opencv
set(OpenCV_STATIC ON)
#second step to use opencv
set(OpenCV_DIR C:/sdk/opencv-3.4.-android-sdk/sdk/native/jni)
#third step to use opencv
find_package(OpenCV REQUIRED)
###########################################################################################
##################################################the native-lib shared library############
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK. add_library( # Sets the name of the library.
native-lib # Sets the library as a shared library.
SHARED # Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp) # Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build. find_library( # Sets the name of the path variable.
log-lib # Specifies the name of the NDK library that
# you want CMake to locate.
log) # Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
native-lib #foutth step to use opencv link opencv
${OpenCV_LIBS}
# Links the target library to the log library
# included in the NDK.
${log-lib})
######################################################################################

仅仅是新建项目稍稍修改了native-lib.cpp的代码,在函数里用了下opencv的函数

#include <jni.h>
#include <string>
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc_c.h" extern "C" JNIEXPORT jstring JNICALL
Java_com_example_useprebuiltstaticlibrary_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello="hello";
cv::Mat m=cv::Mat::eye(,,CV_8UC1);
return env->NewStringUTF(hello.c_str());
}

编译时却报错

Build command failed.
Error while executing process C:\sdk\cmake\3.6.\bin\cmake.exe with arguments {--build C:\sdk\demo\usePrebuiltStaticLibrary\app\.externalNativeBuild\cmake\debug\armeabi-v7a --target native-lib}
[/] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
[/] Linking CXX shared library ..\..\..\..\build\intermediates\cmake\debug\obj\armeabi-v7a\libnative-lib.so
FAILED: cmd.exe /C "cd . && C:\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi23 --gcc-toolchain=C:/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 --sysroot=C:/sdk/ndk-bundle/sysroot -fPIC -isystem C:/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -std=c++11 -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot C:/sdk/ndk-bundle/platforms/android-23/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -LC:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ..\..\..\..\build\intermediates\cmake\debug\obj\armeabi-v7a\libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_highgui.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_features2d.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_shape.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_imgcodecs.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_ml.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_videoio.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_dnn.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_flann.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_objdetect.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_calib3d.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_video.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_superres.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_photo.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_imgproc.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_stitching.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_videostab.a -llog C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibprotobuf.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_calib3d.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_features2d.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_highgui.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_videoio.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_imgcodecs.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibjpeg-turbo.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibwebp.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibpng.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibtiff.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/liblibjasper.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/libIlmImf.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_flann.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_video.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_photo.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_imgproc.a C:/sdk/opencv-3.4.2-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a -lz C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/libtbb.a -lc C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/libcpufeatures.a -ldl -lm -llog C:/sdk/opencv-3.4.2-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/libtegra_hal.a -latomic -lm "C:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_static.a" "C:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a" "C:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a" "-ldl" && cd ."
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) [clone .part.]: error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::ostream::put(char)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::ostream::flush()'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::ostream::put(char)'
.
.
.
.
.
.
.
.
.
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(persistence_json.cpp.o):persistence_json.cpp:function icvJSONParseValue(CvFileStorage*, char*, CvFileNode*): error: undefined reference to 'std::string::at(unsigned int)'
C:/sdk/opencv-3.4.-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a(persistence.cpp.o):persistence.cpp:function check_if_write_struct_is_delayed(CvFileStorage*, bool): error: undefined reference to 'std::string::assign(char const*, unsigned int)'
clang++.exe: error: linker command failed with exit code (use -v to see invocation)
ninja: build stopped: subcommand failed.

google得知是因为编译这些静态库时所用的编译器、标准库等跟NDK当前的版本不同。网上的建议都是stl改为gnustl_static或gnustl_shared之类。可较新的NDK都不支持这些stl了,为了使用OpenCV静态库只能重新编译了。
编译OpenCV4Android的过程里爬了不少坑,总结一下,希望有助于小白们。

1. 安装MinGW
这里不详细的说了,网上很多教程。选择如图三项安装

安装好后差不多二三百兆,在环境变量Path里添加
C:\MinGW\bin
C:\MinGW\msys\1.0\bin
这里C:\MinGW是我的安装目录。配置好后需要注销计算机,再登陆。在命令行里gcc -v看到能输出版本就算差不多设置好环境了。

2. CMAKE 配置
下载好源代码解压,我放在C:\opencv-3.4.2。打开CMAKE图形界面

如图一定要选择MinGW Makefiles,我想这也是为什么一定要先安装配置MinGW的原因。选择指定工具链,点击next

这里一定要注意,选择的不是源代码
\opencv-3.4.2\platforms\android\android.toolchain.cmake
这个工具链,这个工具链过时了。新版本的NDK带有自己的工具链,这里选择NDK
/build/cmake/android.toolchain.cmake这个工具链。
这里感谢
https://github.com/opencv/opencv/issues/8742
点击Finish。有错误别管,点击configure。开始配置。出现错误就再点configure直到遇到一个跳不过去的错误,看看是不是让你配置SDK路径

Android SDK: specify path to Android SDK via ANDROID_SDK_ROOT /
ANDROID_HOME / ANDROID_SDK variables

点击Add Entry添加变量

注意类型是FilePath。点击OK。点击configure。很快又跳出一个错误

CMake Error at cmake/android/android_gradle_projects.cmake: (message):

  Android gradle-based build/projects are not supported in this version of
OpenCV. You need to downgrade Android SDK Tools to version 25.2.. Details: https://github.com/opencv/opencv/issues/8460 Call Stack (most recent call first):
cmake/android/OpenCVDetectAndroidSDK.cmake: (include)
CMakeLists.txt: (include)

这是SDK比较新,新的SDK只支持Gradle编译,而OpenCV需要Ant编译。这里也给出了解决方法
Details: https://github.com/opencv/opencv/issues/8460
就是下载一个较旧的SDK。正如连接所说,windows选择这个
https://dl.google.com/android/repository/tools_r25.2.5-windows.zip
解压后发现里面只有一个tool目录,而SDK里也有一个tool目录。我的做法是先重命名SDK里的tool为tool28。再将下载的tool复制进SDK。
点击configure。(这里可能还是这个错误,这样就需要删除C:\opencv-3.4.2\build里所有内容,重启CMAKE。再来一次。所以这一步最好在CMAKE前就做好。
接下来会遇到这个错误

CMake Error at cmake/android/OpenCVDetectAndroidSDK.cmake: (message):
Android SDK: Can't build Android projects as requested by
BUILD_ANDROID_PROJECTS=ON variable. Use BUILD_ANDROID_PROJECTS=OFF to prepare Android project files without
building them
Call Stack (most recent call first):
CMakeLists.txt: (include)

如图搜索这个变量,取消选择。点击configure。
配置成功。

如图搜做tbb选择两项,否则不生成libtbb.a库,我不知这又什么用,但是预编译的SDK里有这个。
还有其它的一些变量可以配置,比如添加ANDROID_ABI,否则仅仅生成armeabi-v7a。修改变量、添加变量后记得configure。
配置完成点击generate,生成完成。CMAKE可关闭了。

3.编译
命令行进入C:\opencv-3.4.2\build目录,这里有很多配置好的文件,输入mingw32-make,就开始编译。等好久就成功了。

C:\opencv-3.4.\build>mingw32-make
Scanning dependencies of target gen-pkgconfig
[ %] Generate opencv.pc
[ %] Built target gen-pkgconfig
Scanning dependencies of target libcpufeatures
[ %] Building C object 3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/cpu-features.c.o
[ %] Linking C static library ..\lib\armeabi-v7a\libcpufeatures.a
[ %] Built target libcpufeatures
Scanning dependencies of target libjpeg-turbo
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapimin.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jccoefct.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jccolor.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcdctmgr.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jchuff.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcinit.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcmainct.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcmarker.c.o
[ %] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcmaster.c.o
.
.
.
.
.
.
.
.
.
[ %] Linking CXX executable ..\..\bin\opencv_perf_stitching
[ %] Built target opencv_perf_stitching
Scanning dependencies of target opencv_videostab
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/deblurring.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/fast_marching.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/frame_source.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/global_motion.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/inpainting.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/log.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/motion_stabilizing.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/optical_flow.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/outlier_rejection.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/stabilizer.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/wobble_suppression.cpp.o
[%] Linking CXX static library ..\..\lib\armeabi-v7a\libopencv_videostab.a
[%] Built target opencv_videostab
Scanning dependencies of target opencv_test_videostab
[%] Building CXX object modules/videostab/CMakeFiles/opencv_test_videostab.dir/test/test_main.cpp.o
[%] Building CXX object modules/videostab/CMakeFiles/opencv_test_videostab.dir/test/test_motion_estimation.cpp.o
[%] Linking CXX executable ..\..\bin\opencv_test_videostab
[%] Built target opencv_test_videostab

4.配置库
生成的库在
\opencv-3.4.2\build\lib
第三方库在
\opencv-3.4.2\build\3rdparty\lib
将其复制到
\opencv-3.4.2-android-sdk
相应目录下替换掉原来的

现在编译项目则没有链接错误了。

参考文章:
1.https://github.com/opencv/opencv/issues/8742
2.https://github.com/opencv/opencv/issues/8460
3.https://blog.csdn.net/xiao19950820/article/details/77119891

Windows编译OpenCV4Android解决undefined reference to std错误的更多相关文章

  1. [ c++] cmake 编译时 undefined reference to `std::cout' 错误的解决方案

    cmake ..  和 make 之后,出现如下错误 Linking CXX executable ../../../bin/ModuleTest CMakeFiles/ModuleTest.dir/ ...

  2. ubuntu下调试ffmpeg程序出现undefined reference to pthread_once ,undefined reference to uncompress错误

    Ubuntu(版本16.04)下默认配置编译Ffmpeg(版本4.1.3configure 添加选项--enable-threads),将编译好的ffmpeg库添加到程序 中进行编译出现undefin ...

  3. Linux Ubuntu运行线程程序出现undefined reference to ‘pthread_create’和undefined reference to ‘pthread_join’错误。

    Linux Ubuntu运行线程程序出现undefined reference to ‘pthread_create’和undefined reference to ‘pthread_join’错误. ...

  4. 「caffe编译bug」 undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11

    CXX/LD -o .build_release/tools/test_net.binCXX/LD -o .build_release/tools/convert_annoset.binCXX/LD ...

  5. Android APP使用NDK编译后的ffmpeg库出现undefined reference to 'posix_memalign'错误

    在android程序中使用NDK编译后的ffmpeg库的时候出现了如下错误: jni/libs/libavutil.a(mem.o): in function av_malloc:libavutil/ ...

  6. caffe编译时候出现 undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'

    1.编译时候出现 make: * [.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1 /usr/local ...

  7. boost.numpy编译报错:undefined reference to `PyInt_FromLong' libboost_numpy.so: undefined reference to `PyCObject_AsVoidPtr'

    [ 31%] Built target boost_numpy[ 36%] Building CXX object libs/numpy/example/CMakeFiles/dtype.dir/dt ...

  8. 在linux下编译线程程序undefined reference to `pthread_create'

    由于是Linux新手,所以现在才开始接触线程编程,照着GUN/Linux编程指南中的一个例子输入编译,结果出现如下错误:undefined reference to 'pthread_create'u ...

  9. 解决undefined reference to `__poll_chk@GLIBC_2.16' 错误

    出现这个错误,是系统的glibc版本太低了,需要更新 到http://ftp.gnu.org/gnu/glibc/下载新版本的glibc,也不用太高,我选择glibc-2.20.tar.gz   解压 ...

随机推荐

  1. [Swift]LeetCode828. 独特字符串 | Unique Letter String

    A character is unique in string S if it occurs exactly once in it. For example, in string S = " ...

  2. 洛谷P2089烤鸡

    题目链接:https://www.luogu.org/problemnew/show/P2089 题目详情: 题目背景 猪猪hanke得到了一只鸡 题目描述 猪猪Hanke特别喜欢吃烤鸡(本是同畜牲, ...

  3. Feign源码解析系列-核心初始化

    开始 初始化Feign客户端当然是整个过程中的核心部分,毕竟初始化完毕就等着调用了,初始化时候准备的什么,流程就走什么. 内容 从上一篇中,我们已经知道,对于扫描到的每一个有@FeignClient, ...

  4. python获取当前路径

    python获取当前执行命令的路径: #!/usr/bin/env python # -*# coding: utf-8 -*- import os print os.getcwd() python获 ...

  5. java基础(三)-----java的三大特性之多态

    面向对象编程有三大特性:封装.继承.多态. 封装隐藏了类的内部实现机制,可以在不影响使用的情况下改变类的内部结构,同时也保护了数据.对外界而已它的内部细节是隐藏的,暴露给外界的只是它的访问方法. 继承 ...

  6. asp.net core 系列 18 web服务器实现

    一. ASP.NET Core Module 在介绍ASP.NET Core Web实现之前,先来了解下ASP.NET Core Module.该模块是插入 IIS 管道的本机 IIS 模块(本机是指 ...

  7. 从零开始学习PYTHON3讲义(七)条件分支和哥德巴赫猜想

    <从零开始PYTHON3>第七讲 人生是由无数个选择组成,每个选择都有不同的限定条件.现在来说人生有点早是吧:)不过事实的确是这样的. 程序也充满着选择,满足不同的条件,则运行不同的运算. ...

  8. SpringBoot入门教程(四)MyBatis generator 注解方式和xml方式

    MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis 可以使用简单的 XML ...

  9. leetcode — merge-sorted-array

    import java.util.Arrays; /** * Source : https://oj.leetcode.com/problems/merge-sorted-array/ * * * G ...

  10. Spring Cloud Alibaba基础教程:使用Nacos作为配置中心

    通过本教程的前两篇: <Spring Cloud Alibaba基础教程:使用Nacos实现服务注册与发现> <Spring Cloud Alibaba基础教程:支持的几种服务消费方 ...