这里会显示出您选择的修订版和当前版本之间的差别。
jaysnote:linux_c_app_development [2018/12/27 12:12] jaylee 已恢复为旧版 (2018/12/25 14:00) |
jaysnote:linux_c_app_development [2021/06/22 23:14] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | |||
- | |||
- | # 使用VS2017 开发Linux C应用 | ||
- | |||
- | * [Visual C++ for Linux Development](https:// | ||
- | |||
- | * 依赖环境 | ||
- | |||
- | ```bash | ||
- | sudo apt-get install zip openssh-server g++ gdb gdbserver | ||
- | ``` | ||
- | * 配置sshd 支持root账户登录 | ||
- | |||
- | ```bash | ||
- | vi / | ||
- | permitRootLogin yes | ||
- | ``` | ||
- | |||
- | * 重定向uname,默认不支持aarch64 | ||
- | |||
- | ``` | ||
- | echo "echo ARM" > /bin/uname # | ||
- | ``` | ||
- | |||
- | ### include | ||
- | |||
- | 在工程添加了路径添加了.h 文件,尽管在include 时候VS2017已经能够自动补全,但是编译的时候还是提示找不到.h文件。 | ||
- | |||
- | 在编译机器发现对应的.h 并没有直接拷贝过来。 | ||
- | |||
- | 原来同以前的直接include 搜索不一样,.h 同样需要加入工程里面,不然VS不知道拷贝那些文件。 | ||
- | |||
- | **13:46 2018/6/29** | ||
- | |||
- | 对于系统/ | ||
- | |||
- | `C: | ||
- | |||
- | 测试发现原来此过程发生在选项-> | ||
- | |||
- | ![](http:// | ||
- | |||
- | |||
- | |||
- | ### lib | ||
- | |||
- | 动态链接库 | ||
- | |||
- | 属性页-> | ||
- | |||
- | ![库依赖项](http:// | ||
- | |||
- | ``` | ||
- | m | ||
- | microhttpd | ||
- | curl | ||
- | pthread | ||
- | rt | ||
- | log4c | ||
- | ``` | ||
- | |||
- | ## TroubleShooting | ||
- | |||
- | ### Unexpected GDB output from command | ||
- | ``` | ||
- | Unable to start debugging. Unexpected GDB output from command " | ||
- | ``` | ||
- | ![](http:// | ||
- | |||
- | 确定了Linux GDBServer版本 | ||
- | |||
- | ``` | ||
- | root@mxj-zbcs-310:/ | ||
- | GNU gdbserver (Debian 7.7.1+dfsg-5) 7.7.1 | ||
- | Copyright (C) 2014 Free Software Foundation, Inc. | ||
- | gdbserver is free software, covered by the GNU General Public License. | ||
- | This gdbserver was configured as " | ||
- | ``` | ||
- | |||
- | 大概明白了流程, | ||
- | |||
- | https:// | ||
- | |||
- | https:// | ||
- | |||
- | ``` | ||
- | Ah I see, we made a fix for that, and are working on adding ARM64 support, in addition to a way of disabling the architecture check. | ||
- | ``` | ||
- | |||
- | ### Cannot insert breakpoint -1. | ||
- | |||
- | ``` | ||
- | Warning: | ||
- | Cannot insert breakpoint -1. | ||
- | Cannot access memory at address 0x530 | ||
- | ``` | ||
- | |||
- | ### Could not find the ' | ||
- | |||
- | ``` | ||
- | 生了错误。Could not find the ' | ||
- | ``` | ||
- | |||
- | 需要在调试设备上面安装zip(`sudo apt-get install zip`) | ||
- | |||
- | ### Operation not permitted | ||
- | |||
- | ``` | ||
- | &" | ||
- | ``` | ||
- | |||
- | 看起来在通过SSH 和GDServer不能直接操作设备。 | ||
- | |||
- | 尝试更改root账户,还是不行,暂时看来,可以忽略改错误。 | ||
- | |||
- | ### Microsoft.Build.Linux.Shared.ExceptionTTY | ||
- | |||
- | ![](http:// | ||
- | |||
- | https:// | ||
- | |||
- | 最后确定和TERM 类型有关系,更改了`.bashrc`。 | ||
- | |||
- | |||
- | |||
- | </ |