Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

How to add a new library #28

Description

@jfm92

The way to add new libraries in NuttX is pretty similar to Linux.
Also the libraries written for Linux are in majority of the case totally compatible with NuttX, only been necessary some minor modifications.

The .c files of the libraries are save in NuttX/libcs.
To add the new library to the compilation you must go to:
NuttX\libc\Makefile and add the next line:
include folder_name_library/Make.defs

Then, inside the folder, you must create the file Make.defs.
Inside this file you can add the files that you want to compile, and the option that must be check to compile it. Like this example:

ifneq ($(LIBM_ARCH_RINT),y)
CSRCS += library_file.c
endif

Also you must add the dependency folder:

DEPPATH += --dep-path library
VPATH += :library

Then to add the .h files, go to:
NuttX\include\lib_folder

And inside the folder, add the .h files.

Your library is now include.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions