个人觉得 写功能不至于一个文件全部把功能写完吧,模块化
找到了
我找到输出的地方了
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). # native-lib.cpp) people/People.cpp) 这个改成你的Peopei类相对地址,同步一下就行了
你把CMakeLists.txt 的 add_library 改成如上图所示,就行了。不过你会发现 nativate-lib.cpp 就报红了
最好还是配置一下目录,像我下边这样,所有的类都能正常引用了
aux_source_directory(. SOURCE_FILES) aux_source_directory(pople SOURCE_FILES_CORE) list(APPEND SOURCE_FILES ${SOURCE_FILES_CORE}) 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). ${SOURCE_FILES})
Android Studio最右侧,有一个侧着写的Gradle的按钮,点开,项目名 -> app -> Tasks -> other -> externalNativeBuildDebug,双击即可
externalNativeBuildDebug 比较靠下,图里截不到了,往下翻翻就能看到了
Task的Other里面