Explorar o código

add:linux编译添加常见问题

Dozingfiretruck %!s(int64=4) %!d(string=hai) anos
pai
achega
2488fa3c13
Modificáronse 1 ficheiros con 42 adicións e 0 borrados
  1. 42 0
      bsp/linux/README.md

+ 42 - 0
bsp/linux/README.md

@@ -41,5 +41,47 @@ end)
 sys.run()
 ```
 
+## 常见问题
 
+**1:执行`cmake ..`时报错:**
+
+```
+-- The C compiler identification is GNU 8.3.0
+-- The CXX compiler identification is unknown
+-- Check for working C compiler: /usr/bin/cc
+-- Check for working C compiler: /usr/bin/cc -- works
+-- Detecting C compiler ABI info
+-- Detecting C compiler ABI info - done
+-- Detecting C compile features
+-- Detecting C compile features - done
+CMake Error at CMakeLists.txt:14 (project):
+  No CMAKE_CXX_COMPILER could be found.
+
+  Tell CMake where to find the compiler by setting either the environment
+  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
+  to the compiler, or to the compiler name if it is in the PATH.
+
+
+-- Configuring incomplete, errors occurred!
+See also "/data/home/lqy/code/LuatOS/bsp/linux/build/CMakeFiles/CMakeOutput.log".
+See also "/data/home/lqy/code/LuatOS/bsp/linux/build/CMakeFiles/CMakeError.log".
+```
+
+**答:未安装g++,执行`sudo apt-get install g++`**
+
+**2:执行`make`时报错:**
+
+```
+[ 99%] Building C object CMakeFiles/luatos.dir/src/lua.c.o
+/data/home/lqy/code/LuatOS/bsp/linux/src/lua.c:82:10: fatal error: readline/readline.h: 没有那个文件或目录
+ #include <readline/readline.h>
+          ^~~~~~~~~~~~~~~~~~~~~
+compilation terminated.
+make[2]: *** [CMakeFiles/luatos.dir/build.make:76:CMakeFiles/luatos.dir/src/lua.c.o] 错误 1
+make[1]: *** [CMakeFiles/Makefile2:265:CMakeFiles/luatos.dir/all] 错误 2
+make: *** [Makefile:130:all] 错误 2
+
+```
+
+**答:缺少libreadline-dev依赖包,造成找不到readline.h,执行`sudo aptitude install libreadline-dev`**