We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
以下是我的编译环境信息 android studio 3.6.3 ndk 21.1.6352462 com.android.tools.build:gradle:3.6.3
CMakeLists.txt ` cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fopenmp") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffast-math") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffast-math") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
include_directories(include)
file(GLOB _SRC *.h *.cpp)
add_library(libncnn STATIC IMPORTED ) set_target_properties(libncnn PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libncnn.a)
#编译为动态库 add_library(ncnn-jni SHARED ${_SRC})
target_link_libraries(ncnn-jni libncnn android jnigraphics omp log) ` cmake version 3.10.2 minSdkVersion 16 targetSdkVersion 29 模拟器是x86_64 Android 10.0(Q)
The text was updated successfully, but these errors were encountered:
#976 (comment)
参考这里的
Sorry, something went wrong.
#976 (comment) 参考这里的
感谢回答,根据上面链接的说明解决错误
refer to android/ndk#1028, use the target_link_libraries (styletransferncnn -static-openmp -fopenmp) in the CMakeLists.txt
No branches or pull requests
以下是我的编译环境信息
android studio 3.6.3
ndk 21.1.6352462
com.android.tools.build:gradle:3.6.3
CMakeLists.txt
`
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fopenmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffast-math")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffast-math")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
include_directories(include)
file(GLOB _SRC *.h
*.cpp)
add_library(libncnn STATIC IMPORTED )
set_target_properties(libncnn
PROPERTIES IMPORTED_LOCATION
${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libncnn.a)
#编译为动态库
add_library(ncnn-jni SHARED ${_SRC})
target_link_libraries(ncnn-jni
libncnn
android
jnigraphics
omp
log)
`
cmake version 3.10.2
minSdkVersion 16
targetSdkVersion 29
模拟器是x86_64 Android 10.0(Q)
The text was updated successfully, but these errors were encountered: