在Android NDK中找不到文件

发布于 2025-01-23 14:15:50 字数 547 浏览 1 评论 0原文

当我创建一个新的.c文件和.h文件。 我使用cmake进行编译。 是我的cmakelists.txt。 我是NDK新秀。

cmake_minimum_required(VERSION 3.4.1)

add_library( 
        native-lib
        SHARED
        native-lib.cpp)

find_library(
        log-lib

        log)


target_link_libraries( 
        native-lib
        jnigraphics
        ${log-lib})

这是CPP文件夹结构

“在此处输入图像描述”

我应该进行什么修改?

i want use malloc lib when i create a new .c file and .h file .android studio tell me 'malloc.h' file not found.
I use CMake to compile.
is my CMakeLists.txt.
I am a ndk rookie.

cmake_minimum_required(VERSION 3.4.1)

add_library( 
        native-lib
        SHARED
        native-lib.cpp)

find_library(
        log-lib

        log)


target_link_libraries( 
        native-lib
        jnigraphics
        ${log-lib})

This is the cpp folder structure

enter image description here

What modification should I make?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一枫情书 2025-01-30 14:15:50

我知道。我需要将.c文件添加到add_library

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
    stackblur.c)

I know. I need to add a .c file to add_library .

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
    stackblur.c)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文