新一个 Linux Project (MSBuild),确保可以编译通过,本项目只演示引入Qt Core,其它的以此类推
打开项目属性 Visual GDB Project Properties
1. 选择 MSBuild Settings 选项卡
Include directories: /opt/Qt5.12.0/5.12.0/gcc_64/include;/opt/Qt5.12.0/5.12.0/gcc_64/lib;/opt/Qt5.12.0/5.12.0/gcc_64/include/QtCore
Library directories: /opt/Qt5.12.0/5.12.0/gcc_64/lib
Library names: Qt5Core
Additional Linker inputs: 因编译时一直提示说找不到这两个类库
/opt/Qt5.12.0/5.12.0/gcc_64/lib/libicui18n.so.56;/opt/Qt5.12.0/5.12.0/gcc_64/lib/libicuuc.so.56;/opt/Qt5.12.0/5.12.0/gcc_64/lib/libicudata.so.56
2. Debug settings 选项卡
LD_LIBRARY_PATH: /opt/Qt5.12.0/5.12.0/gcc_64/lib
3.IntelliSense Directories 选项卡
点击 Edit remote cache,在弹出窗口中增加 /opt/Qt5.12.0/5.12.0/gcc_64/include
4. 项目上点右键,打开 “属性”,“配置属性\C++\Command Line", 输入 -std=c++11 -fPIC -DPIC
大功告成,开始远程一键编译、发布、调试、打断点吧!