前言
本板性能強勁,運行Debian桌面系統,所以我們完全可以直接板上開發,避免交叉編譯開發帶來的繁瑣,本篇就以Sqlite3的編譯測試為例來進行,體驗直接板上進行C開發。
安裝gcc工具鏈等可能需要比較大的空間,可參考如下文檔。
http://m.xsypw.cn/d/2185811.html
http://m.xsypw.cn/d/2184550.html
聯網,配置源可參考文檔:
http://bbs.eeworld.com.cn/thread-1249527-1-1.html
http://bbs.eeworld.com.cn/thread-1249396-1-1.html
安裝工具
sudo apt update
sudo apt upgrade
sudo apt-get install lrzsz //rz sz文件傳輸使用
sudo apt install make
sudo apt install gcc
sudo apt install git
sudo apt install tcl
sudo apt-get install tcl-dev
sudo apt install zlib1g-dev
下載源碼
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
或
git clone https://github.com/sqlite/sqlite.git
構建
cd sqlite/
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../configure ;# Run the configure script
make sqlite3.c ;# Build the "amalgamation" source file
make ;# Run the makefile.
構建大概花了不到20min,也還是可以接受的,
運行 ./sqlite3
root@starfive:~/sqlite/bld# ./sqlite3
SQLite version 3.43.0 2023-07-18 13:55:19
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite >
測試
make test ;# Run some tests (requires Tcl)
make test ;# Run some tests (requires Tcl)
如果報如下錯誤
/usr/bin/ld: /tmp/cccaPGbP.o: in function `fillInCell':
/root/sqlite/bld/./sqlite3.c:75921: undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
make: *** [Makefile:714: sessionfuzz] Error 1
則
nano Makefile 添加-lz
報錯tcl.h找不到,則查找
/usr/include/tcl8.6/tcl-private/generic/tcl.h
/usr/include/tcl8.6/tcl.h
添加頭文件包含路徑
如果提示tcl相關函數未定義
添加-ltcl
測試結果如下
總結
得益于開發板強勁的性能,直接在板上進行C開發非常方便,構建一般規模的項目時間還是可以接受的,省去了交叉編譯的麻煩。
審核編輯:湯梓紅
-
usb
+關注
關注
60文章
7988瀏覽量
266259 -
計算機
+關注
關注
19文章
7549瀏覽量
88716 -
GCC
+關注
關注
0文章
108瀏覽量
24900 -
開發板
+關注
關注
25文章
5126瀏覽量
98320 -
交叉編譯
+關注
關注
0文章
32瀏覽量
12701 -
單板計算機
+關注
關注
0文章
74瀏覽量
15707 -
編譯
+關注
關注
0文章
661瀏覽量
33066 -
RISC-V
+關注
關注
45文章
2328瀏覽量
46669
發布評論請先 登錄
相關推薦
昉·星光單板計算機正式發售,加速RISC-V生態發展
![<b class='flag-5'>昉</b>·<b class='flag-5'>星光</b><b class='flag-5'>單板計算機</b>正式發售,加速<b class='flag-5'>RISC-V</b>生態發展](https://file.elecfans.com/web2/M00/24/4D/poYBAGGxWteAFQ4OAAOe_XmqCRc904.png)
評論