Skip to content
New issue

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

Add a new .a library to the apps directory #8835

Closed
xiaotailang opened this issue Mar 16, 2023 · 2 comments
Closed

Add a new .a library to the apps directory #8835

xiaotailang opened this issue Mar 16, 2023 · 2 comments

Comments

@xiaotailang
Copy link

Hello! I have a library file called my.a. I tried creating my own folder called my_dir under apps/examples, and placed the .a library file in it. I also wrote a my.c source file with a function called my_func, which calls a function inside my.a. In the Makefile, I added LDLIBS += -Lapps/examples/my_dir -lmy to link the my.a file. However, when I tried to generate nuttx.bin, it gave an error saying that the function my_func in my.o generated from my.c was undefined when calling the function inside the my.a library file. Is my approach incorrect? Is there anything else I need to consider?

@acassis
Copy link
Contributor

acassis commented Mar 16, 2023

Hi @xiaotailang other alternative is using the EXTRA_LIBS:
https://acassis.wordpress.com/2020/10/06/linking-external-libraries-on-nuttx/

@xiaotailang
Copy link
Author

Hi @xiaotailang other alternative is using the EXTRA_LIBS: https://acassis.wordpress.com/2020/10/06/linking-external-libraries-on-nuttx/

Thank you. Following your advice, the compilation has been successful and it can be used normally. Thank you very much for your help. Wish you all the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants