这里会显示出您选择的修订版和当前版本之间的差别。
jaysnote:linux_c_app_development [2018/12/27 12:11] jaylee |
jaysnote:linux_c_app_development [2021/06/22 23:14] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | * [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: | ||
- | |||
- | 测试发现原来此过程发生在选项-> | ||
- | |||
- | ![](images/ | ||
- | |||
- | |||
- | |||
- | ### lib | ||
- | |||
- | 动态链接库 | ||
- | |||
- | 属性页-> | ||
- | |||
- | ![库依赖项](images/ | ||
- | |||
- | ``` | ||
- | m | ||
- | microhttpd | ||
- | curl | ||
- | pthread | ||
- | rt | ||
- | log4c | ||
- | ``` | ||
- | |||
- | ## TroubleShooting | ||
- | |||
- | ### Unexpected GDB output from command | ||
- | ``` | ||
- | Unable to start debugging. Unexpected GDB output from command " | ||
- | ``` | ||
- | ![](images/ | ||
- | |||
- | 确定了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 | ||
- | |||
- | ![](images/ | ||
- | https:// | ||
- | |||
- | 最后确定和在`~/ | ||
- | |||
- | > **提示**: | ||
- | |||
- | ### cannot open display | ||
- | |||
- | 调试 gtk 桌面引用提示不能代开显示。 | ||
- | |||
- | ``` | ||
- | Unable to init server: Could not connect: Connection refused | ||
- | |||
- | (factory_test.out: | ||
- | ``` | ||
- | |||
- | 所有的x 桌面应用都一致需要指定显示的`x server`。 | ||
- | |||
- | ``` | ||
- | export DISPLAY=:0 | ||
- | ``` | ||
- | |||
- | 同时,`x server` 限制连接账号。所以如果要通过`root`调试,会麻烦一些。 | ||
- | |||
- | ``` | ||
- | export DISPLAY=:0 | ||
- | xhost + # | ||
- | cp / | ||
- | ``` | ||
- | |||
- | </ |