Page 1 of 1

How to build custom application in C/C++?

Posted: 2024-07-29 1:24
by avinash_gupta
Hello,

I have read the whole wiki but there is no document as how to compile my own applications and link with various libraries available in SDK. I have seen the LVGL demo and doing the same way that is to use a CMake based project system. Also how to debug application using gdb and some IDE would be very helpful.

Re: How to build custom application in C/C++?

Posted: 2024-07-30 2:32
by Crocodile
Hello, there are various methods and environments for linking libraries, and we cannot cover each one. There are many references available online and on the market. If you need to operate GDB, you can refer to viewtopic.php?p=452&hilit=GDB#p452

Re: How to build custom application in C/C++?

Posted: 2024-07-31 1:44
by avinash_gupta
Thank you.

Re: How to build custom application in C/C++?

Posted: 2024-07-31 4:18
by avinash_gupta
In the lvgl demo they have used a CMake based build system, so I have used the same idea to build my applications also.
I copied their CMakeLists.txt file and made few changes to make a simple template to build application using sources files in the src directory. I created a main.c file in this src directory and tried to compile and run it.
I copied the compiled executable to /avinash dir of my Luckfox Pico board using scp command discussed below. Then I ran the application and following screenshot shows the output of the program. Simply print a line of text using printf.
2024-07-31 08_47_58-Window.png
SFTP: SSH File Transfer Protocol
Push file to another host using SFTP. Use command scp.

Code: Select all

scp -r file_path user@host:target_path
-r means file can be directory and it is copied recursively.
example
2024-07-31 08_34_35-Window.png