Comments (10)
Cmake你用的是自己之前的 还是用AS下载的?
我之前解决问题好像主要是在AS里面下载了一个Cmake
ta使用的Cmake版本是3.10.2 (app/build.graddle 里面写的
然后就是 jni/CmakeLists.txt 里面的路径该改需要改
其他的问题我也不了解
from feeds.
啊我用的as下载的,新安装的as,还不太会用,请问该怎么操作?怎么修改路径?
from feeds.
我的jni/CmakeLists.txt内容如下
project(styletransferncnn)
cmake_minimum_required(VERSION 3.4.1)
set(ncnn_DIR ${CMAKE_SOURCE_DIR}/ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
find_package(ncnn REQUIRED)
add_library(styletransferncnn SHARED styletransferncnn_jni.cpp)
target_link_libraries(styletransferncnn ncnn)
app/build.graddle和cmake相关的内容如下
externalNativeBuild {
cmake {
version "3.10.2"
path file('src/main/jni/CMakeLists.txt')
}
}
}
from feeds.
CMakeLists.txt 里面
set
是设置变量名
你看你ncnn的路径对不对
Tools->SDK Manager->SDK Tools 这里面可以下载 AS的CMake 不过要保证版本和build.graddle里面的信息匹配
from feeds.
我的ncnn文件相对路径是
app/src/main/jni/ncnn-20210720-android-vulkan
请问是对的吗?
我下载了全部的cmake版本,目前有3个(3.18.1 3.10.2.XX... 3.6.4XX...)
build.graddle里面写的需要version "3.10.2",我这个算有吧,不过就是有小版本号
from feeds.
${CMAKE_SOURCE_DIR}
表示那个cmakelists文件的路径
版本号写完全吧
from feeds.
啊有点不太懂
我的cmakelists.txt的相对路径是app/src/main/jni/CMakeLists.txt
请问该怎么写?
我这样写还是不行
set(ncnn_DIR ${CMAKE_SOURCE_DIR}/app/src/main/jni/ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
build.graddle的cmake版本改成了我装的版本
version "3.10.2.4988404"
还是不行
from feeds.
${CMAKE_SOURCE_DIR} 表示那个cmakelists文件的路径
这里的根目录是项目打开路径
如果你的ncnn文件路径是
app/src/main/jni/ncnn-20210720-android-vulkan
那么就是
set(ncnn_DIR ${CMAKE_SOURCE_DIR}/ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
不行的话 可以试试 set(ncnn_DIR ./ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
用相对路径试试
from feeds.
哦哦,我分别尝试了这两个
set(ncnn_DIR ${CMAKE_SOURCE_DIR}/ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
set(ncnn_DIR ./ncnn-20210720-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
但还是不行
话说我最上面log提示的是the c compiler,感觉解决问题方向可能弄错了。
from feeds.
解决了,是ndk版本原因。谢谢了
from feeds.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feeds.